Set ACAD Object Color to ByLayer

With the help of many, many, many posts on the Dynamo Forum, I think I’ve been able to crack it.

Using two Camber nodes, Document.SendCommand and Object.Select I realised I could access the CHPROP command in ACAD. Then I could use the WaitFor/PassThrough code found in another post, to sequence the actions to:

  1. Set selected objects layer,
  2. Select objects within ACAD,
  3. Set selected objects colour property to ByLayer.

The final String node executes the CHPROP AutoCad command and then walks through the options as if you were typing in the command line. To exit the command requires an extra space at the end.

This seems to work, although it may not be the most elegant. Unless someone can spot any obvious flaw, I’ll mark this as Solved. This would also seem to allow other general object properties to be set, not just colour.

Special thanks to @mzjensen for the Camber nodes and all the posts!

(There should be a graph below with the node combination I used)

2 Likes