Where to Find the List of Options When Creating an MLeader DStyle

Where to Find the List of Options When Creating an MLeader DStyle

mgorecki
Collaborator Collaborator
920 Views
4 Replies
Message 1 of 5

Where to Find the List of Options When Creating an MLeader DStyle

mgorecki
Collaborator
Collaborator

I have lisp code that allows me to create an mleader style, I found it in the forums and it contained a list of options like textheight, scale, etc...

(defun CreateMLeaderStyle (dwg_scale / CMS_MLeaderStyles CMS_NewMLeaderStyle CMS_ColorObject)
 (setq newMlStyleName "Amkor")
 (if (tblsearch "STYLE" "ROMANS")
  (progn
   (setq CMS_MLeaderStyles (vla-item (vla-get-Dictionaries (vla-get-ActiveDocument (vlax-get-acad-object))) "ACAD_MLEADERSTYLE"))
   (if (vl-catch-all-error-p (vl-catch-all-apply 'vla-item (list CMS_MLeaderStyles newMlStyleName)))
    (progn
     (setq CMS_NewMLeaderStyle (vla-AddObject CMS_MLeaderStyles newMlStyleName "AcDbMLeaderStyle"))
     ;(vla-put-ColorIndex CMS_NewMLeaderStyle 256) ;color = bylayer
     ;(vla-put-ArrowSymbol
     (vla-put-ArrowSize CMS_NewMLeaderStyle 4.40)
     (vla-put-MaxLeaderSegmentsPoints CMS_NewMLeaderStyle 2)
     ;(vla-put-EnableDogleg 
     (vla-put-DogLegLength CMS_NewMLeaderStyle 5.0) ;Landing length
     (vla-put-ScaleFactor CMS_NewMLeaderStyle dwg_scale)
     (vla-put-TextStyle CMS_NewMLeaderStyle "ROMANS")
     (vla-put-TextAngleType CMS_NewMLeaderStyle 1)
     ;(vla-put-TextColor CMS_NewMLeaderStyle 256)
     (vla-put-TextHeight CMS_NewMLeaderStyle 2.20)
     (vla-put-TextLeftAttachmentType CMS_NewMLeaderStyle 1) ;Middle
     (vla-put-TextRightAttachmentType CMS_NewMLeaderStyle 1) ;Middle
     (vla-put-LandingGap CMS_NewMLeaderStyle 0.125)
     ;(vla-put-ExtendLandToText
    )
    (princ "\n ** Error: MLeader style already exists")
   )
  )
  (princ "\n ** Error: textstyle does not exist")
 )
 (princ)
)

I have a few questions:

1.  How do I set the General "Color" setting to "Bylayer"?

2.  How do I set the ArrowSymbol to "Closed-Filled"?

3.  How do I enable "Automatically include landing"?

4.  How do I turn off "Extend leader to text"?

 

Thanks,

Mark

0 Likes
Accepted solutions (1)
921 Views
4 Replies
Replies (4)
Message 2 of 5

Jonathan3891
Advisor
Advisor

Properties for a MLeader style are:

 

AlignSpace
Annotative
ArrowSize
ArrowSymbol
BitFlags
Block
BlockColor
BlockConnectionType
BlockRotation
BlockScale
BreakSize
ContentType
Description
DoglegLength
DrawLeaderOrderType
DrawMLeaderOrderType
EnableBlockRotation
EnableBlockScale
EnableDogleg
EnableFrameText
EnableLanding
FirstSegmentAngleConstraint
LandingGap
LeaderLineColor
LeaderLinetype
LeaderLineTypeId
LeaderLineWeight
MaxLeaderSegmentsPoints
Name
ScaleFactor
SecondSegmentAngleConstraint
TextAlignmentType
TextAngleType
TextAttachmentDirection
TextBottomAttachmentType
TextColor
TextHeight
TextLeftAttachmentType
TextRightAttachmentType
TextString
TextStyle
TextTopAttachmentType


Jonathan Norton
Blog | Linkedin
0 Likes
Message 3 of 5

mgorecki
Collaborator
Collaborator

hi Jonathan,

Thanks for the list.  Where did you get them?  Do you know where there is detailed information on their usage?

 

I was trying to set the color to "ByLayer" and I read somewhere to set it to 256, but that doesn't seem to work.

 

Thanks,

Mark

0 Likes
Message 4 of 5

Kent1Cooper
Consultant
Consultant
Accepted solution

@mgorecki wrote:

....  Where did you get them?  ....


There are different "classes" of "properties."  For any object that is the last thing drawn, you can get one list from:

(vlax-dump-object (vlax-ename->vla-object (entlast)))

which you can use with VLA-object-based operations, and another from:

(dumpallproperties (entlast))

which you can use with (getpropertyvalue) and (setpropertyvalue) functions.

[Never mind -- that's about drawn entities, not things like Styles.]

Kent Cooper, AIA
0 Likes
Message 5 of 5

mgorecki
Collaborator
Collaborator

Hi Kent,

Thank you very much, that did the trick!!

0 Likes