.NET

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

mText

466 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 (457 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 (438 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
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!