Hello! I think I need some help from someone that understands Lists and Levels better than I do.
I have a couple of Corridors (with one Baseline each, although I would like the scripts to cover situations with multiple Baselines per corridor as well) and I’d like to extract solids from certain shapes and then output them into the DWG with layers according to the codes that were extracted.
I get all the Solids into Dynamo. No matter if the baseline has the specific shape code or not, but when I go to output them into C3D I run into issues with actually getting either all solids to output, or getting the correct layer name. No matter what I’ve tried there is always some issue.
Does anyone have any idea on how to fix this?
Some text in the script is in Swedish but hopefully it will be clear either way 
Hej
No issues with the Swedish letters/words but it might be so because of I’m Swede 
Can you try to edit the level for the geometry input?
Hälsningar från Stockholm! While I’d love to practice my Swedish vocabulary we’ll keep the written exchanges to English as that’s the language of the forum.
This appears to be a lacing issue - do you need each individual component, or can you work with combined solids?
Either way, flatten the list of codes before you wire it in which should help sort things out, making the input to the Solids.ByRange a list of strings and the layer names a list of strings as well - both are currently lists of lists.
After that, try changing the geometry input to @L3 and the layer name to @L1 and setting lacing to longest should work, but it may be @L4 and @L1.
Generally I find it easiest to resolve this type of problem with for a simple dataset and then apply it to your project(s).
Start a new DWG and build the world’s simplest set of 3 corridors which have known and identifiable results for you to see and work with - this way you can identify more readily what is going on.
2 Likes
Hälsningar från Stockholm även här!
@L3 and @L1 gives me this. Basically one corridor recieves one type of code. Using @L4 instead gives me 4 different solids for each shape.
1 Like
Did you want each corridor to receive each code?
1 Like
Nope.
I want each Solid from a shape to recieve the shapes code as a layer name, no matter which corridor it is extracted from. I have the code ‘Förstärkningslager’ in two of the corridors, ‘Ledningsbädd’ and ‘Kringfyll’ are in two others and ‘Grus’ is found in three different corridors.
I think we need to confirm the structure and output of the proceeding node before we move into writing to the DWG.
Do you want to extract all feature codes from all corridors? Can you post a sample DWG and your DYN and note which Civil 3D build you’re using?
1 Like
Sure, here is a DWG with the corridors that I’ve been working on and the DYN.
I want to extract some number of shapes according to a list given as an input string.
Corridor solids sample.dwg (3.8 MB)
Extract corridor solids with layer coding.dyn (53.9 KB)
I think I’ve solved it. Flattened the corridor inputs and then set Keep List Structure for the inputs of the different codes. Then @L3 and @L1 for geometry and layerName respectively in the Object.ByGeometry node.
Colors are different than the example above, but this is the result I was after 
1 Like
Hi, Can someone help me? That workflow is not working for me. I don’t know why
Hi, you might need to specify what the actual problem is.
1 Like