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

Changing MTextAttribute.Contents has no effect

2 REPLIES 2
Reply
Message 1 of 3
axelgenus
555 Views, 2 Replies

Changing MTextAttribute.Contents has no effect

I'm writing a program to perform massive block's attributes changes automatically. Normal attributes does change correctly setting the property AttributeReference.TextString but MTextAttributes does not work as expected: when I change AttributeReference.TextString I cannot use special characters (such as '\P' to start new lines) and if I try setting the AttributeReference.MTextAttribute.Contents property the content of the attribute does not change at all!

 

How can I solve the problem?

 

Thank you,

Alessandro.

2 REPLIES 2
Message 2 of 3
FRFR1426
in reply to: axelgenus

I'm a bit late, but it may be useful to someone. Try this:

 

MText mText = attRef.MTextAttribute;
mText.Contents = "...";
attRef.MTextAttribute = mText;

 

This way, the setter of the MTextAttribute property is called and the attribute update itself. I change the width of the attribute like this and it works (but I've not tested the Contents property).

 

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
Message 3 of 3
CADbloke
in reply to: FRFR1426


@FRFR1426 wrote:

(but I've not tested the Contents property).

 


I did and this works. THANK YOU.

- - - - - - -
working on all sorts of things including www.tvCAD.tv & www.CADreplace.com

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost