New Member
Posts: 2
Registered: ‎01-17-2012
Message 1 of 2 (242 Views)

Changing MTextAttribute.Contents has no effect

242 Views, 1 Replies
01-18-2012 05:46 AM

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,


Valued Contributor
Posts: 92
Registered: ‎04-05-2012
Message 2 of 2 (173 Views)

Re: Changing MTextAttribute.Contents has no effect

11-12-2012 02:06 AM 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).


Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!