Hi
I use Civil 3D with Dynamo and want to set up a script where it takes the block and place it on each x,y,z coordinates from a excel sheet.
Can anyone help with that?
Hello @FKNZ,
maybe this will help you. You can also find many similar explanations in the forum.
Thank you - Yes, I saw similar topics but can´t find anything that fits my purpose
Hi Faizan,
I applaud your willingness to learn how to do this with Dynamo, but this is not difficult to do with >>>Excel and AutoCAD<<<
Dave
Thank for kind words and link. Reason to I thought about Dynamo is to maybe find a way to put blocks perpendicular to for instance to an road alignment. I have marker boards as blocks.
And I get invalid result when following the excel video in your link
Faizan,
OK, then how about >>>This<<<, with a DYN script on message #2?
Dave
Sorry for the last post in the other thread, I was on the run from the bus and didn’t saw this.
Which version av C3D do you use?
How is the coordinate described in the excel/csv file? Will they be separated by ; or by tab?
Do you have more information in the excel regarding type of block to insert, will there be different types of blocks or just one type?
Please share what you have tried so far
I would have done like this, there you have something to start with and play around a little bit
blocks.xlsx (8.5 KB)
This is for C3D 2025.1, it might differ if you use 2023 or 2024
Hi Patrick
Thank you, I´m glad to get help - It´s 2024 version. I´m trying out your example, but I can´t find “Choose block name”, “block.getblockbyname” and “blockreference.bypoint”. What can I use instead in 2024 version?. And what is the first letter/symbol in the codeblock to the left from “point by coordinates”? The excel file with coordinates is attached here as well as the block.
It would be nice if the names of each block can be included. And later on, I´d like to rotate the markerboards perpendicular to the road alignment.
Markerboard_2.xlsx (9.6 KB)
Markerboard.dwg (458.2 KB)
Hola amigo @FKNZ buenas. you can feed the BlockName parameter whit the name of the block as string.
I let you an other topic related!
Buenas tardes Senor Gilberto:) Thanks for sharing the inspiration!
I have made up something I will attach here as would like to get the errors solved.
I think i´m getting closer to a solution.
Objects by excel coord.dyn (27.6 KB)
Markerboard.xlsx (15.4 KB)
Markerboard.dwg (458.5 KB)
Amigo @FKNZ buenas. I felt like a teacher , no offense, you almost had it 85 / 100, the point node gives an error maybe because you have some empty cells or data that are not taken and generats nulls, or is not taken as int or double, maybe you should check it, just change the imput that I indicate and it will work!
Hehe sir Gilberto, where do I put the 1/2 value?
Think we are getting closer now since it now shows the objects in the window behind the diagram
Amigo @FKNZ buenas. My bad i have to correct myself my last correction, you have an extra node! the node Block.Name will return the name of a block, just conect the name of your block to the node Document.BlcokByName will works!!
this are the kind of think you have to verify over and over, but that is the way we lern, good luck!!
Amigo Gilberto, we are getting there:), I only have two warnings now and dont get objects in the current drawing in civil 3d - I enjoy and appreciate a lot your help.
Amigo @FKNZ buenas. you will fail the course!! you are feeding the parameter X with strings, that is why the node Point.ByCoordinates complains!! when you get a warning like: “the node… expects arguments type(s)” allways check the type of data what the parameters spects and check if you are feed it with the right data type!! i advice you to read or re read Dynamo premier, you can find it in the resources secction, this hand book is very help full!!
Ah how could overlook that
The x was before pointing to the naming of each objects, It has of course to be the x-coordinates.
Even though I would also like to add the description to them, know how to do?
Now having one warning left with “blockreference.create”
What the Warning says? should be working now, there are new instances of your block in the .dwg or not??
add the description, how do you want to proced, ading attrivutes to the block? or directly text nested into the block, bouth are posible with dynamo, but that is an other story for an other topic, and before you create a new one try to read the existing ones they are a couple already!!