Ad

Wednesday, August 17, 2022

Modify XSL Reports to Remove Spaces in Bearings and Directions

This blog post shows how to find the locations of the spaces in the direction found in the bearings or directions in the LandXML reports.

If you open the xsl files in the report files (C:\ProgramData\Autodesk\C3D 2023\enu\Data\Reports\xsl\) you should be able to find the locations where the directions are being formatted. In the image below I've searched for ""S " in Notepad++ and found some of the locations. Go in and change "S " to "S" and that should give you the results you are looking for. Also do this for the locations where "W ", "E ", and "N ".

The dashes in the image below is where the spaces placeholders are being added:

You would then need to find where the "-" is being turned into spaces by looking where the formatAngleToDMS is called from. 


Searching for "+ " " + " should find the locations. 






Saturday, August 06, 2022

Visual Studio Code => Setup Java Maybe?

These are some random notes. Ignore. 

This installs wsl from Terminal in Visual Studio Code:

  • sudo apt install wsl
This sets JAVA_HOME, but really didn't work. Needed to install java on WSL2:
  • export JAVA_HOME="/mnt/c/DeleteMe/java/java-1.8.0-openjdk-1.8.0.342-1.b07.redhat.windows.x86_64"
This installs java jdk:
  • sudo apt install default-jdk
WSL commands were not working as expected. The WSL needed to be updated to get everything setup correctly. I, unfortunately, didn't write down the command. 

To view a file in Visual Studio Code, just click on the file in Explorer. It's possible to do in Terminal, but I think I'm a GUI person at this point.
    

Rebuild in the Java Projects, not the files.
    
For the code, need to rebuild and clear any errors.


Monday, March 21, 2022

Demo Palette Commands

Some code to help in doing my demos. It goes into the Tool Palette as commands and then I can press the command in the Tool Palette to run the command. 

This does a Save As file: 

^C^C(vla-saveas (vla-get-ActiveDocument (vlax-get-Acad-Object)) "C:/Civil 3D Projects/DFWBIUG_Test_A/Sewer/Phase 2/A_Phase1_Sewer_B_Street_Start.dwg");

Note:

  • The backslashes in the drawing path are forward slashes. 
  • The ^C^C clears the command line. 

This opens a file:

^C^C(LM:open "C:/Civil 3D Projects/DFWBIUG_Test_C/SampleCreateDS.dwg"); 

The tool palettes also work as an agenda so I can remind myself what I'm doing next.

The LM:open is modified from Lee Mac: http://lee-mac.com/open.html with totally different code.

Monday, May 17, 2021

SHOWLAYERUSAGE

 There appears to be a setting in AutoCAD that will prevent layers from indicating if objects are on them or not. The system variable is SHOWLAYERUSAGE. A value of 0 turns of the ability of AutoCAD to show if objects are on a layer. A value of 1 enables the ability of AutoCAD to indicate if a layer is in use. 

It appears this variable was created to improve drawing performance. In Civil 3D the value defaults to 0, or OFF. So if you want to see layer usage then you will want to set the value to 1. Not sure how badly this affects drawing performance. It sure would be nice if Autodesk created another thread to do the work instead of having it on the UI thread that makes the drawing performance go down. 

I guess if you hear an Autodesk developer say they can't think of a reason why multithreading is necessary, you can point them to this workaround they did instead of utilizing multithreading.

Coordinate System - Status Bar

 It would be useful to show the coordinate system in the status bar. 

One way to accomplish the task is to use the Map command MAPSTATUSBAR and set the value to SHOW. 


This, unfortunately, adds a bunch of other junk that is most likely not wanted, especially when using a small monitor. 

Another way to accomplish the task is to add the information using ModeMacro. This allows you to populate a box on the StatusBar with information. To do so in LISP, you could copy and paste this line to the command line: 

(setvar "MODEMACRO" (getvar "CGEOCS"))

 This will get the current coordinate system string and add it to the ModeMacro field. 

To clear the value you can use the following line that will remove the coordinate system:

(setvar "MODEMACRO" "")

You can then expand the concept with more advanced code that tracks when the coordinate system changes, using PointMonitor. 

This blog post has an example of using the PointMonitor: 

    https://www.tek1.com.au/point-monitor-hello-world-autocad-net-api/ 

To get and set variables you can use the following code: 

var coordCode = Application.GetSystemVariable("CGEOCS");

Application.SetSystemVariable("MODEMACRO" coordCode);

LinkWithin

Blog Widget by LinkWithin

Ad