Author Topic: Losing Block Name  (Read 576 times)

0 Members and 1 Guest are viewing this topic.

kshitij.jadhav@cctech.co.

  • Mosquito
  • Posts: 1
Losing Block Name
« on: May 23, 2024, 10:56:57 AM »
While developing an AutoCAD plugin in .NET, I encountered an issue where creating two new visibility states and setting this visibility to a block reference causes the block name to change to a format like UXXX (where X represents any digit). Although I can retrieve the original name from the dynamic table record, is there an alternative approach to prevent the block name from changing?

Jeff H

  • Needs a day job
  • Posts: 6151
Re: Losing Block Name
« Reply #1 on: May 23, 2024, 11:19:32 AM »
When you insert blocks(BlockReference) they can only vary by position, rotation, and scaling from its definition(BlocktableRecord). So you really can not have a block that has different entities or representations of itself and have the ability to be dynamic.
AutoCAD does this by creating anonymous definitions(BlockTableRecords) naming them *UXXX for each of the dynamic states needed for all the references inserted in a drawing.


retsameht

  • Newt
  • Posts: 22
Re: Losing Block Name
« Reply #2 on: May 27, 2024, 01:10:44 AM »
While developing an AutoCAD plugin in .NET, I encountered an issue where creating two new visibility states and setting this visibility to a block reference causes the block name to change to a format like UXXX (where X represents any digit). Although I can retrieve the original name from the dynamic table record, is there an alternative approach to prevent the block name from changing?

Your question was answered on the Autodesk .NET forum.  You can't prevent the block name from changing, and you shouldn't be relying on the names of anonymous blocks to start with.