Reset AttributeReference.Position

Reset AttributeReference.Position

Ertqwa
Advocate Advocate
779 Views
2 Replies
Message 1 of 3

Reset AttributeReference.Position

Ertqwa
Advocate
Advocate

Hello Forum,

I want to reset the value of AttributeReference.Position back to its original value.

The following does not work, because AttributeReference.Position is in modelspace and AttributeDefinition.Position is in the block definition.

 

AttributeReference.Position = AttributeDefinition.Position
or
AttributeReference.AlignmentPoint = AttributeDefinition.AlignmentPoint

 

There are similar questions on the internet, but they do not answer this. Is there an easy way to do this?

 

Thank you.

0 Likes
Accepted solutions (1)
780 Views
2 Replies
Replies (2)
Message 2 of 3

_gile
Consultant
Consultant
Accepted solution

Hi,

Try:

AttributeReference.Position = AttributeDefinition.Position.TransformBy(br.BlockTransform);
or
AttributeReference.AlignmentPoint = AttributeDefinition.AlignmentPoint.TransformBy(br.BlockTransform);

Where br is the instance of BlockReference containing the attribute reference.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 3

Ertqwa
Advocate
Advocate

Hello,

 

Yes that's it.

 

Thank you.

0 Likes