Change Layer of objects inside Blocks - Python

Hi all,

I am trying to create a script that will change the layers of objects within a block to layer zero so the block can just be controlled by its insertion layer. I have tried the dynamo / python script (see attached) but for some reason it says that the block does not exist when I know it does. I am new to the python game so any constructive feedback or help would be huge!

(I know this can be done with out of the box nodes, just trying to get more familiar with accessing civil3d within python/dynamo)

block_layers_to_0-sample.dwg (496.5 KB)
CONVERT - BLOCK_LAYERS_TO_LAYER_0_Sample.dyn (11.5 KB)

Current Code if you dont want to open the dynamo file…

Hi @JYzerman,

Do you have a specific requirement to use Python? If not, this is a pretty easy task with just a few nodes.

Hey @zachri.jensen! Sorry I should of lead with this but I am more so trying to get used to the boiler plate with a simple operation within dynamo. Trying to get over that hurdle as I have only done/used out of the box nodes to date.