.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

changing visibilty is changing block name

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
kshitij_jadhav
252 Views, 4 Replies

changing visibilty is changing block name

when i change visibilty one of the visibility is giving block reference name as "U99" when checking in debug mode. Are there any fix for this?

4 REPLIES 4
Message 2 of 5
_gile
in reply to: kshitij_jadhav

Hi,

This is the way dynamic blocks work. As soon as you edit some dynamic properties of a dynamic block reference, AutoCAD creates a new anonymous block definition (BlockTableRecord).

You can retrieve the name of the original block definition via the DynamicBlockTableRecord property of a block reference.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 5
kshitij_jadhav
in reply to: _gile

is there a workaround to avoid block name change

 

Message 4 of 5

That is how dynamic block works. Workaround? If you really want to work around the block reference becoming anonymous block, then do not use dynamic block; or, only insert the block reference with its original dynamic properties and do not change them (then why use dynamic block at all?).  You may want to explain why you have such a unusual requirement.

 

Norman Yuan

Drive CAD With Code

EESignature

Message 5 of 5


@kshitij_jadhav wrote:

is there a workaround to avoid block name change

 


The workaround is to fix your application's design so that it does not rely on the names of anonymous blocks.

 

An app or plugin should never rely on the names of anonymous blocks, for the reasons described above, and because an anonymous dynamic block reference can be copied any number of times. When that happens, all of the copies reference the same anonymous dynamic block. When one of the copies is modified, it will reference another new anonymous block having a different name, while the other unmodified copies will still reference the previous anonymous block.

 

Describe your need for depending on anonymous block names, and perhaps someone can suggest a way to resolve it, but there is no workaround that can prevent an anonymous dynamic block's name from changing when the user modifies its properties.

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Forma Design Contest


AutoCAD Beta