Ad

Tuesday, December 20, 2022

Open Databases By Core Console

I've added code to the https://github.com/C3DReminders/DFWBIUG_C3D_Data_Shortcuts_2020 repository to demonstrate how to open drawings without using the UI and extracting information from them using the AutoCAD core console. This method allows for the opening of drawings via multithreading. This sample code creates a simple text file, but the concepts could be expanded. 

The name of the command is "OpenDbsByCoreConsole" and it is located in the OpenDatabasesCoreConsoleCommand class. 

Note that some of the code was retrieved from the "Autodesk Batch Save Utility (Standalone)" by looking at the decompiled dll code. 

Monday, December 19, 2022

Open Databases By Side Loading

I've added code to the https://github.com/C3DReminders/DFWBIUG_C3D_Data_Shortcuts_2020 repository to demonstrate how to open drawings without using the UI and extracting information from them. This sample code creates a simple text file, but the concepts could be expanded. 

The name of the command is "OpenDbsBySideLoading" and it is located in the OpenDatabasesCommand class. 


Sunday, December 18, 2022

Corridor Surface Point Codes

 I've added some code to the https://github.com/C3DReminders/DFWBIUG_C3D_Data_Shortcuts_2020 repository that demonstrates how to get which point codes are being used by a corridor surface. 

This is useful when you want to assign property set information to a corridor feature line when it is extracted from a corridor for use in another program. 

In the code sample, the name of the command is "CorrSurfPointCodes" and it is in the "CorridorFeatureLinesCommand" class. 

Friday, November 25, 2022

Property Set Units

It appears one has to add a "Property Data Format" to the drawing in Style Manager. Once you do that, use the Format column on the Property Set Definition tab to select the desired format and then the unit drop-down will then become available with the set units available for the unit type specified in the Property Data Formats. I changed Standard to Area and then the area options was then available.




Sunday, October 16, 2022

Image Transient Graphics

 I uploaded an attempt to draw an image using transient graphics to github.
https://github.com/C3DReminders/DFWBIUG_C3D_Data_Shortcuts_2020

It doesn't work well, but it's a start.

Thursday, October 06, 2022

Sample Reports = Alignments

 Civil 3D comes with sample code. It is a great place to start when writing code. For Civil 3D 2023, the code is located here: C:\ProgramData\Autodesk\C3D 2023\enu\Data\Reports\Net\Source

"C:\Program Files\Autodesk\AutoCAD 2023\C3D\Sample\Civil 3D API\DotNet\C3DDotNetSamples.sln"

Sunday, August 28, 2022

AutoCAD Fields: Layout Name Conversion

 One can use Diesel expressions to convert data in AutoCAD. In this case, I want to convert the layout tab name to a fuller name. So if I have CIV I want the field to show "Civil" and if the layout tab name is "INF" it should be "Infrastructure". 

$(if,$(eq,$(getvar, "ctab"),"CIV"),"Civil",$(if,$(eq,$(getvar, "ctab"),"INF"),"Infrastructure","Error"))

The help topic for Diesel expressions may be found here: 

https://knowledge.autodesk.com/support/autocad-lt/learn-explore/caas/CloudHelp/cloudhelp/2019/ENU/AutoCAD-LT/files/GUID-F94A885A-4DA2-432B-AC1A-EB49CC6C1C72-htm.html 

Note that the link will probably die in 3 to 4 years. 

Here is a video showing it in action: https://youtu.be/zUpX04RfnNA 

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.

LinkWithin

Blog Widget by LinkWithin

Ad