Community
Sub KBR_MLeaders()
StrMLeaderStyle = "500m"
Dim BlnMLSExists As Boolean
BlnMLSExists = False
Dim oDict As AcadDictionary
Set oDict = ThisDrawing.Dictionaries.Item("ACAD_MLEADERSTYLE")
Dim i As Long
For i = 0 To oDict.Count - 1
Dim oObj As AcadObject
Set oObj = oDict.Item(i)
If oObj.ObjectName = "AcDbMLeaderStyle" Then
Dim oMLS As AcadMLeaderStyle
Set oMLS = oObj
If oMLS.Name = StrMLeaderStyle Then
BlnMLSExists = True
End If
End If
Next i
If BlnMLSExists = False Then
Dim oNewMLS As AcadMLeaderStyle
Set oNewMLS = oDict.AddObject(StrMLeaderStyle, "AcDbMLeaderStyle")
oNewMLS.LeaderLineType = acStraightLeader
oNewMLS.ArrowSize = 2.5
oNewMLS.ContentType = acMTextContent
oNewMLS.EnableLanding = True
oNewMLS.LeaderLineTypeId = "Continuous"
oNewMLS.LandingGap = 1.5
oNewMLS.DoglegLength = 5
oNewMLS.LeaderLineColor = acRed
oNewMLS.MaxLeaderSegmentsPoints = 2
oNewMLS.ScaleFactor = 500
oNewMLS.TextHeight = 3.5
oNewMLS.TextColor = acYellow
oNewMLS.TextLeftAttachmentType = acAttachmentMiddleOfTop
oNewMLS.TextRightAttachmentType = acAttachmentMiddleOfTop
oNewMLS.TextAlignmentType = acLeftAlignment
oNewMLS.TextStyle = ISOCP
End If
Call ThisDrawing.SetVariable("CMLEADERSTYLE", StrMLeaderStyle)
ThisDrawing.SendCommand "Mleader" & vbCr
End Sub
Thanks in advance
Brent