Author Topic: subentities of a block  (Read 829 times)

0 Members and 1 Guest are viewing this topic.


  • Mosquito
  • Posts: 12
subentities of a block
« on: August 03, 2022, 03:37:13 PM »
I want to write a routine that takes the ename of a block and returns a list of all the subentities in that individual block. I want to process all the entities in the block and change their visibility state. I've tried this several times and the change takes effect on every block in the drawing. I don't want that, I want it to change on only the blocks I have picked. Any ideas how to stop this generic changing and focus on the individual block?

Lee Mac

  • Seagull
  • Posts: 12929
  • London, England
Re: subentities of a block
« Reply #1 on: August 03, 2022, 04:46:32 PM »
By operating on the subentities within the block definition, you'll inevitably affect all references of the block definition in the drawing, as this is precisely how blocks in AutoCAD work.

If you're looking to change the visibility state of a dynamic block reference, you should instead modify the value of the appropriate dynamic block property object corresponding to the visibility state parameter.  Such dynamic block properties may be accessed using the ActiveX getdynamicblockproperties method (examples here).

When the visibility state (or indeed, any dynamic block property) of a block reference is changed, AutoCAD will automatically generate a separate anonymous block definition containing the altered geometry (unless such an anonymouse definition for that combination of dynamic properties already exists in the active drawing), and the block reference will reference the anonymous block definition.