Results 1 to 1 of 1

Thread: Place Annotative Mtext

  1. #1
    100 Club
    Join Date
    Columbus, OH
    Login to Give a bone

    Question 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
    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

    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
    Attached Files Attached Files
    Last edited by mhannan.100562; 2021-12-10 at 09:14 PM.

Similar Threads

  1. Annotative MEP Blocks not doing the annotative thing
    By pauljordan in forum AMEP General
    Replies: 0
    Last Post: 2010-07-07, 10:38 PM
  2. Annotative Attribute in Non-Annotative Block
    By c.mcmahon in forum AutoCAD Annotation
    Replies: 5
    Last Post: 2010-04-09, 08:23 PM
  3. Annotative attribute in non-annotative block
    By thegreyguy in forum AutoCAD Annotation
    Replies: 0
    Last Post: 2009-07-24, 03:58 PM
  4. Annotative Blocks lose annotative properties
    By CAD-MAN II in forum AutoCAD Civil 3D - General
    Replies: 5
    Last Post: 2009-06-03, 01:50 PM
  5. Toggle annotative / non annotative
    By bowtle in forum AutoLISP
    Replies: 0
    Last Post: 2008-05-09, 04:58 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts