Hi all,
Im having trouble getting ALL geometry i see in my CIVIL3D model space in Dynamo.
I can get part of it to work but for some reason not everything is showing.
Below is geometry preview in Dynamo, and the civil3D model space:
As you can see, a bunch of parts are missing.
We are looking at a solidworks step export of piping. The export puts all the assemblies from solidworks in blocks and nested blocks, which is fine but there seems to be an issue that recurring blockreferences dont get imported into Dynamo properly.
The most obvious example is this Solidworks pattern which contain a bunch of pipes:
The picture above was one block, if we go into that block we can see the following block:
Inside here we can see 2 blocks, both recurring multiple times:
Finally inside these blocks, we can see another blockreference, which is the pipe itself.
This blockreference is what i’m looking for. When we go a layer deeper we get a 3D solid, so there’s no more nested blockreferences after this one. These last block references in the entire project contain the information i need, as they tell me the position of the piping and the block description tells me the diameter/shape etc.
How do i go about getting all deepest nested block references in this file?
I thought i would just get the blocks in the project I need with this filter:
I then get the objects in a block, which are all solids, so that’s good. I get the geometry and translate it according to the blockreference coordinatesystem to get the correct position.
So, the idea of the script is good, it works how i want it to work, but apparantly you can’t do this when theres copied nested blockreferences involved, Dynamo can’t see the blockreference of the deepest block is occuring multiple times in copied nested blockreferences (if that makes sense)…
What would be the best way to go about this?
I was thinking i could create a python script that has a recursive function to check the content of a blockreference, and if its not a 3Dsolid, explode the blocklayer, if it is, stop exploding.
This way i should end up with only blockreferences that contain 3D solids without all the copied references?
Before i go this route i wanted to ask for input here, since I feel like there is probably something i’m missing…
Even after exploding the nested blocks manually, i only get the geometry of the first group:
Which is odd, since when I select the blockreferences, they all have the same name so i am sure they are the same, and i can see theres a lot of them…
Another edit…
Ok so i think i found part of the issue
I went ahead and focus on the missing groups for now, so i altered the filter in such a way that i only get this specific block.
In civil3D i get 72 occurances, but somehow in Dynamo i can get 96…
All the geometry is placed over eachother at the position of the first group. Theres 96 solids in the space of these 12: