Move blocks to layer

Hi guys,

I have a lists of points based on blocks locations in cad. The points are filtered by the ones located within an area. How can i move the blocks to a different layer using the filtered point list to just move the ones i want?

Did you try AutoCAD.Objects.Object.SetLayer() ?

1 Like

Paolo, using the AutoCAD.object.SetLayer would be the main goal but first i need to limit my selection by the only including the blocks within my limit of disturbance. For that i have a reference point with the coordinate system values of just the blocks inside the limit of disturbance. But i am having trouble selecting the blocks using the coordinates. I tried first to use point itself and then extracting the x, y, z (default) values to create a point coordinate to filter the selection without luck.

Drawing1.dwg (921.5 KB) Drawing1.dwg (921.5 KB)SurveyConversion.dyn (33.2 KB)

@csanchez you are creating new blocks when you call BlockReference.ByCoordinates().
If you haven’t noticed, all the Dynamo nodes that contain the “By” keyword in their names will create some kind of object (in this case it tries to create new BlockReferences using the CoordinateSystems… but you are passing Points so it won’t work).
Also, in case you were actually trying to create new BlockReferences you can specify directly the Layer name so no need to set the layer afterwards.

In reality you want to filter the existing BlockReferences: in the List.FilterByBoolMask[List] should be the output of Block.BlockReferences(). This input will feed the Object.SetLayer[Object] node.

Works really well, thank you Paolo.

1 Like