Dynamo for Dummies (lesson 1)

I am trying to retrieve data (volume, in this case) from 3D Solids in C3D that represent volumes of soil to be excavated (please see example in the picture below).

It is “impossible” for a noob like me to find the correct node to do this operation and any help will be very much appreciated.

In my real world problem, there are different layers so I would like to extract the individual volumes of one layer only (each layer represents a type of material). In the picture above, the volumes are to be excavated in that order, according to the chainage.

What I came up so far (after working it for about 6h) is shown below. I know it can be “optimised” but the way it is makes it more “explicit” for me.

Is there any place I can learn this stuff, please? It looks like AutoDesk produced Dynamo for Revit or to work with corridors in C3D, not to mention its non-backwards compatibility…

PS: I also would like to work in the correct coordinates of the volumes - that I can possibly retrieve from the dwg but have no idea how…

Thank you very much in advance again!

Hi @alexmotta19,

Once you’ve selected the solids (looks like you have that part), then use an Object.Geometry node to get the geometry in the Dynamo workspace. After that, add a Solid.Volume node to list the volumes.

You’re in the right place! This forum is the best resource. There are also some great AU courses that I could link for you if interested.

Can you explain what you mean by this or what issue you’re running into?

2 Likes

Hi, @mzjensen!

Firstly, thank you very much for this! You made it very simple and I got what I needed.

image

Thank you very much for your support and kind words!

“not to mention its non-backwards compatibility…”

I meant that the Dynamo I am using (embeded in C3D 2021) is “different” from the Dynamos I see in videos - YouTube and AutoDesk site (the nodes are different and lots of them do not exist in “my” version) - please let me know if I cleared it?

MANY THANKS AGAIN!

2 Likes

No problem! :slightly_smiling_face:

When we talk about “Dynamo” it can mean different things. The core version of Dynamo (intuitively called Dynamo Core) is a collection of bundled components that consist of the graphical interface, the computation engine, the scripting language DesignScript, and the out-of-the-box nodes that are not specific to another program like Revit or Civil 3D. So this means that you can actually download Dynamo Core as a standalone executable (called Dynamo Sandbox) and use it completely independent from any other host application. However, this does mean that it won’t be able to “talk” to Civil 3D, or in other words, you won’t see any nodes for AutoCAD or Civil 3D in Dynamo Sandbox.

Dynamo for Civil 3D is basically just Dynamo Core running together with Civil 3D, and it includes additional nodes specifically for interacting with AutoCAD and/or Civil 3D objects. That’s what these shelves are for in the library:

And in fact, these nodes have not changed since Dynamo for Civil 3D was originally released in Civil 3D 2020. That effectively means that you can save out a graph to a .dyn file and be able to open and run that same graph in any version of Dynamo for Civil 3D.

What you are likely facing is that you don’t have a package installed that is being used in whatever videos you are watching. Packages are basically add-ons, developed by other users like yourself, to make Dynamo more powerful by adding new nodes. You just need to go here to download packages:

5 Likes

Thank you very much for this, @mzjensen! (APologies for the delay…)

@mzjensen, may I ask if you would know how to extract the layer of each solid?

I wish to export a list with the 3D solids and their layers (I don’t know how to “call” each solid yet though) as an Excel file and need to learn how to “get their layers”…

Many thanks again!

The Object.Layer node should work.

2 Likes

Additionally, to get the solids you can use nodes on the selection shelf. Object by Layer > will get you all objects in a given layer, Object by Type > all objects of a given type. The Civil 3D Toolkit package allows you also to select graphically multiple objects

2 Likes

Thank you, @mzjensen. I had actually done that but forgot to load the script. I noticed that the list of layers follows the same order that the list of volumes (I mean that I am stating that there is consistency in it, not inventing the gun powder!).

I think I can work with this - I was just thinking that I could extract the layer from the “geometry” but I was not thinking “Dynamo”. I see now that everything related to each object is available after the node “All Objects of Type”.

Thank you!

Thank you for this, @david_licona!

I wanted to avoid having to work with layers that are not relevant to me (no solids in them) - I hope this makes sense?

@mzjensen and @david_licona,

Thank you both again for your help.

Please let me show what I am trying to automatise (please don’t laugh! :slight_smile: ):

From a number of 3D solids, I want to generate the spreadsheet above.

If they come in two columns (column1 = layers and column2 = volumes), sorted by layer, I am happy.

Thank you again for any advice!

@alexmotta19 Can you please share an example .dwg and your current .dyn. I can help you with the excel table generation output.

@WrightEngineering , thank you very much for your offer and please accept my apologies fo rthe delay in getting back to you.

I am attaching the file (it actually has 6 volumes since I split one of them in two to have 2 volumes in the same layer).

“Interestingly”, the script I was using decided to “not work” and now I cannot retrive the volumes from the DWG (I swear it was working until 1 minute ago with no changes!).

Many thanks again!
Kind regards,
Alexandre.

Dynamo Test - 5 Volumes.dwg (542.1 KB)

1 Like

Thanks. I will take a look.

Go figure… I am totally puzzled now - part of script decided to run. The other part, however, “identical”, won’t…

Alexandre,

I believe this is what you’re trying to accomplish. I tried to make it as verbose as possible. This will select all objects of the “solid” type that are on a layer containing the string “Volume”, return their volume value, group the volumes by layer number, find the sum according to the layer number and then export to csv.

Hope this helps.

Dynamo Test - 5 Volumes.dwg (573.3 KB)
SolidVolumeToExcel.dyn (68.4 KB)

4 Likes

Fantastic, @WrightEngineering!

Many many many thanks!

1 Like