VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

value of mtext

7 REPLIES 7
Reply
Message 1 of 8
ralph.poh
421 Views, 7 Replies

value of mtext

Hi.
How is it possible to read the value of an selected mtext?

Ralph
7 REPLIES 7
Message 2 of 8
joesu
in reply to: ralph.poh

oMText.TextString

Joe
--
Message 3 of 8
ralph.poh
in reply to: ralph.poh

OK.
I've tried it a view times, but I seem to be to stupied for it.
Could you please give me an example for an selected MText?

Ralph
Message 4 of 8
joesu
in reply to: ralph.poh

Disclaimer!!! No error checking in this example!

Dim aObject As AcadEntity
Dim Point As Variant

'select the Mtext
ThisDrawing.Utility.GetEntity aObject, Point, "Select an entity"

'check ObjectName property for MText
If UCase(aObject.ObjectName) = "ACDBMTEXT" Then

'cast object to proper data type
Dim oMText As AcadMText
Set oMText = aObject

'display the text string in a MsgBox
MsgBox oMText.TextString

That should do it. Let me know if you need further help.

Joe
--
joesu@worldnet.att.net
Message 5 of 8
ralph.poh
in reply to: ralph.poh

Is it possible to use the textstring without selecting the object by the ACADUser. I think of selecting the object with vba.

Ralph
Message 6 of 8
joesu
in reply to: ralph.poh

Ralph,

You would need to create a selection set of MText objects.

Joe
--
Message 7 of 8
ralph.poh
in reply to: ralph.poh

I have selected the mText Obejcts in the ActiveSelectionSet.
Could you give me an example for getting the TextString for the first Item?

Ralph
Message 8 of 8
ralph.poh
in reply to: ralph.poh

I got it.
Thank you joe for helping from Ralph from Germany

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

Post to forums  

Autodesk Design & Make Report

”Boost