.NET

Reply
New Member
damyan.lyaskov
Posts: 2
Registered: ‎10-16-2012
Message 1 of 3 (225 Views)
Accepted Solution

change the style of created obj or change the style and create that obj

225 Views, 2 Replies
10-16-2012 07:16 AM

One general question for all the .net gurus out there.

 

It’s my understanding that every time a new object is created, Mtext for example, its created with the current style, Mtext style in my case.

 

I remember that when I used to code with Autolisp, I will always first change, for example the MText Style to the desired one and after that create the Mtext object.

 

Do I need to do the same here or just changing the MTextStyleID to the new MText Style will change all the properties of the Mtext object based on that MText Style.

 

Thank you.

 

 

 

Hello,

 

When you create an MText entity, call the "SetDatabaseDefaults" method. This will ensure that the default values including the default style is assigned to the MText entity.

 

If you then want to have a different MTextStyle, then create a new MTextStyle and assign the ObjectId of it to the MText entity as its "MTextStyleId".

 

You can also choose to open the MTextStyle object using its objectId inside a transaction.

Changes made to the MTextStyle and then committed to the database will get reflected in all the MText entities that refer to this MTextStyle.

 

Hope this helps.

 

 

ADN Support Specialist
Balaji_Ram
Posts: 737
Registered: ‎03-21-2011
Message 2 of 3 (175 Views)

Re: change the style of created obj or change the style and create that obj

10-23-2012 08:47 AM in reply to: damyan.lyaskov

Hello,

 

When you create an MText entity, call the "SetDatabaseDefaults" method. This will ensure that the default values including the default style is assigned to the MText entity.

 

If you then want to have a different MTextStyle, then create a new MTextStyle and assign the ObjectId of it to the MText entity as its "MTextStyleId".

 

You can also choose to open the MTextStyle object using its objectId inside a transaction.

Changes made to the MTextStyle and then committed to the database will get reflected in all the MText entities that refer to this MTextStyle.

 

Hope this helps.

 

 



Balaji
Developer Technical Services
Autodesk Developer Network

New Member
damyan.lyaskov
Posts: 2
Registered: ‎10-16-2012
Message 3 of 3 (159 Views)

Re: change the style of created obj or change the style and create that obj

10-25-2012 05:23 AM in reply to: Balaji_Ram

Thank you.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
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!