I spend a lot of time cleaning up my grading files. I would like to automate the process using Dynamo. Ultimately, I would like to create a script that can:
- Check For Identical Assembies (including all Parameters under the Advanced section of the Properties menu for each subassembly)
- Select one of those duplicates to be the “primary assembly”
- Replace all regions within a corridor that have a duplicate assembly with the primary assembly
- Delete the duplicate assemblies from the drawing/model space
I have found some useful nodes, but nothing that checks the Parameters of the subassemblies. I’ve tried ObjectExtensions.GetParameters, but this does not provide the information I need. If there’s a way to do this in python, I’d appreciate some pointers. Thanks in advance!
I don’t know anything about Civil3D, so not sure if these are an option for you. Look at the Assemblies.Members node from archilab to get all subcomponents of the assembly. And look at the Element.SubComponents node from clockwork to get all subcomponents of a family.
Do you know if there’s a way to do this with Python? I would prefer to not use third party packages besides the Civil3DToolkit and Camber
I noticed you invoke the Revit API will this code still work within Civil 3D?
That, I can’t answer as I have never worked with Civil3D. I didn’t think about that honestly. @jacob.small may be able to answer that question, as I believe he has given demonstrations using Dynamo with Civil3D.
It will not work. The two code bases are discrete and have no overlap. Also subassemblies in civil 3D are not the same as assemblies in Revit; they are more like wall types, with civil 3d’s assemblies being the swivel and id stacked walls.
1 Like
I deleted my post above with the code, because it was incorrect. Thanks for clarifying @jacob.small .
1 Like
I think to access this data you will need to parse the subassembly directly via API as I am not sure of any package which access the data correctly at this scale.
Hi, sometimes ObjectExtensions.GetParameters can help you: Civil 3D Toolkit Feedback thread - #628 by Drbohlav
H @jacob.small and @austin_perigee, to access subassemly parameters you can use workaround if you have corridors in your document. You can use AppliedSubassemly.Parameters node: Change Subassembly parameter at particular region - #4 by Drbohlav
Thank You, it looks like this gets me the information I need. I would prefer to use the
Subassembly.GetSubassemblies node and feed that into a
Subassembly.Parameters node. However, is there a reason why the parameter
Name variable outputs as a number instead of the actual name like the applied subassembly node does? Is there to way match up the number to its actual name?
Hi
Sorry my language is not good
I am not trying this before
So I am not sure if this you are searching
https://help.autodesk.com/view/CIV3D/2024/ENU/?guid=d31f00a4-0313-c69d-0091-ebc69897a962
Is there a way to find which Assemblies (not just Subassemblies) are used by each corridor region?
Hope this can help:
Be careful. Please note that this works for corridors created from an alignment and a profile.
Thank You! This does help
Hi @austin_perigee, You can get name instead of number
The answer was here Check Subassembly Properties And Delete Duplicate Assemblies - #10 by Drbohlav
Here is my new test graph, where you can see it.
2 Likes