.NET

Reply
Distinguished Contributor
quigs
Posts: 143
Registered: ‎09-30-2008
Message 1 of 3 (465 Views)
Accepted Solution

mText

465 Views, 2 Replies
05-12-2010 07:08 AM
Hi there,
I am adding some mtext to a jigs worlddraw. Using:

Dim Tx As New MText
Tx.Location = “a 3d point”
Tx.Contents = “a var that I have created”
draw.geometry.draw(tx)

The mtext displays fine, but I have tried in vain to change the font, to another but I am having no luck. Can anyone suggest a way that I may do that. Any font would do, so I can test it works.

Thanks,

Martin.
My name is Martin.. :smileyvery-happy:

Hi,

I have found the solution:

 

      ' Get Font
            Dim acTextStyleTblRec As TextStyleTableRecord
            acTextStyleTblRec = acTrans.GetObject(acCurDb.Textstyle, OpenMode.ForWrite)
            acTextStyleTblRec.FileName = "Arial"
            acTrans.Commit()
            ' Mtext
            Dim IP As Point3d = InsPt
            Dim MText As New MText
            MText.Attachment = AttachmentPoint.BottomCenter
            MText.Contents = "21"
            MText.TextHeight = 6.4
            MText.Location = InsPt
            MText.ColorIndex = 7
            MText.TextStyle = acCurDb.Textstyle
            draw.Geometry.Draw(MText)

Distinguished Contributor
quigs
Posts: 143
Registered: ‎09-30-2008
Message 2 of 3 (456 Views)

Re: mText

06-26-2010 12:36 PM in reply to: quigs

Hi,

I have found the solution:

 

      ' Get Font
            Dim acTextStyleTblRec As TextStyleTableRecord
            acTextStyleTblRec = acTrans.GetObject(acCurDb.Textstyle, OpenMode.ForWrite)
            acTextStyleTblRec.FileName = "Arial"
            acTrans.Commit()
            ' Mtext
            Dim IP As Point3d = InsPt
            Dim MText As New MText
            MText.Attachment = AttachmentPoint.BottomCenter
            MText.Contents = "21"
            MText.TextHeight = 6.4
            MText.Location = InsPt
            MText.ColorIndex = 7
            MText.TextStyle = acCurDb.Textstyle
            draw.Geometry.Draw(MText)

My name is Martin.. :smileyvery-happy:
*Expert Elite*
Hallex
Posts: 1,569
Registered: ‎10-08-2008
Message 3 of 3 (437 Views)

Re: mText

06-27-2010 12:26 AM in reply to: quigs

Martin,

Thanks for sharing the solution

Regards,

Oleg

 

~'J'~

_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.