Python: Select all Solid3D and Civil3D objects (Corridors, pipes, pressure pipes) and export properties (i.e. Handle) to CSV across multiple dwgs

There are dynamo nodes that can select the object by type or obtain the Civil3D objects, but this only works at the current active document.

The goal is to use Python (Civil3D API) to [select all the Solid3D and Civil3D Objects → obtain the handle of each object → then export the handles into a csv] for each of the dwgs within the folder. The purpose of using python is to allow the script to run on each of the dwgs in the folder.

At the moment, the simple code below gives out the handle of the selected objects only at the current active document.

I have used the Dynamo sample “Dump Properties to CSV” so I have an idea on how to export those csv.

I have read the other forums regarding “running the script across dwgs within a folder” and the script and help that they provided works.

The only problem I have left is to identify how to select all the Solid3D and Civil3D Objects using Python so I can link my code together to achieve the goal.

Hi @Ian.Alindada,

If you haven’t already, check out the Camber package. There are several nodes for working with documents other than the current one.

1 Like

Hi @mzjensen,

Thank you for introducing me to the Camber Package, it has alot of useful nodes! I also looked over the updates on the Github page and found the nodes that could help me (see image below)

However, I seem to be missing those nodes and some other updates on the latest version (4.1.4). I installed the package using the ‘Online Package search’ inside dynamo. Is there something that I missed?

→ I just found out that the Camber package requires a specific Civil3D version. My version at the moment is 2021.2 so some of the necessary members would not be present.

Yes, please install the latest Civil 3D updates.