Inserting Block with Attributes and changing values

Hi

I am new to Dynamo for Civil3d but have done a bit of programming in VB and C# .net in the past.

For my first script I am trying to insert blocks at the mid points of lines that our local council gives us with a number of attributes attached. Which we then fill out by hand (hopefully by Dynamo in the future) and then they pull into an arcgis layer with FME.

I am able to find the midpoint of the line and then insert the supplied block but the attributes do not come in. I read in these forums that this was an issue and has been updated in 2021. Can someone share an example on inserting and existing block definition with attributes and then access the attributes to update them.

Regards

Justin Ralston

Hi @ralstogj,

Something like this? I’m assuming you won’t want to set all of the values the same, but I’m just keeping it simple.

Blocks

Hi

Yes something similar but using blocks already defined in the drawing.

Attached is a dwg with the predefined blocks I am working with.

Sorry could not upload the dwg file of prefined blocks as a new user. You can see in the image above the predefined block for a sump and its attributes and what I get when trying the script I wrote.

Will try to recreate yours but not sure if will work with predefined block.

Regards

Justin

ok got to work seems to work with some blocks and not others.

Maybe that the blocks its not working on are dynamic have to investigate further.

Justin