Hello, first post!
I am toying around with the idea of creating a script that would use a csv file to automatically create an assembly at every station specified, with a subassembly template placed and then its points modified based on the x,y point coordinates in the csv.
The structure of the csv file would be: ({Station} > {{Point ID}, {X}, {Y}}), so at station 1000, there would be 24 unique point rows, each with an X,Y specification, then the next station, with 24 more rows, and so on, to modify the subassembly template.
This would be my first serious attempt at coding my own script file, so I would like to inquire if what I'm asking is even doable. I have created pseudo-code to better explain what my goal is (yes, haha, my pseudo is also unbearable):
Sub_template = Subassembly.import(subassembly.pkt) \\get my subassembly template file Prop_table = Loadfile(properties.csv) \\import table of values Prop_table.columns = {Station},{Point_No},{X_from_origin},{Y_from_origin} \\what each column contains Dim My_align as alignment.select \\select alignment for each Station in Prop_table \\for every station, My_align.Station.CreateAssembly \\Create an assembly Sub_template.place(0,0) \\Place the subassembly template at the origin for each Point_No where Station == Station.current \\replace the x and y values for every point respectively Subassembly.Point_No.X = Station.Point_No.X_from_origin \\until all points have been changed based on the csv Subassembly.Point_No.Y = Station.Point_No.Y_from_origin next next for each Station in Prop_table \\Merge all regions to create a continuous corridor Station.Assembly.Merge.ToNext \\(this is a moonshot, but it would also be great if this could be done) next
The result of this pseudo-code would be to have a corridor with tens of assemblies, each with modified points.
Has anyone attempted something similar to this before? I have tried researching the C3D developer's guide but I get stuck on modifying the points of my subassembly based on the coordinates that I specify in my csv. So far, the only way I have been successful in changing subassembly points is by selecting the assembly, then modifying the parameters.
Solved! Go to Solution.
Solved by Thomas.nowakNUQZB. Go to Solution.
Answered my own question: Got it working in Dynamo! Thanks Dynamo team!
Can't find what you're looking for? Ask the community or share your knowledge.