-
1 Attachment(s)
Place Annotative Mtext
I'm recreating a DCL menu to VBA and I need help with the VBA coding.
The menu has a list of door sizes that I would like to place in model space using the annotative scale for the text height, place middle center justified, user input for rotation & with a background mask.
(bonus: place on the correct layer by check layer list for two different groups of layers (i.e.. groups A & B if layer group A is being used place on layer A-door-size, if group B is used then put on B-door-size))
Every example I find starts with:
Dim MTextObj As AcadMText
Dim corner(0 To 2) As Double
Dim width As Double
Dim text As String
I was able to get a start on this.
What I have so far is as follows:
Private Sub CommandButton2_Click() '1068
Me.Hide
Dim MTextObject As AcadMText
Dim P(0 To 2) As Double
Dim Width As Double
Dim Text As String
Dim newlayer As AcadLayer
Set newlayer = ThisDrawing.Layers.Add("A-Unit-Door-Size")
ThisDrawing.ActiveLayer = newlayer
P(0) = 0: P(1) = 0: P(2) = 0
Width = 5
Text = "1068"
Set MTextObject = ThisDrawing.ModelSpace.AddMText _
(P, Width, Text)
MTextObject.AttachmentPoint = acAttachmentPointMiddleCenter
MTextObject.Update
End Sub
I'm attaching my menu, if someone could help with one button, I can figure out the rest.
Thank you all in advance!
Matt Hannan