Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I want to be able to create a multileader style if it doesn't exist in a drawing. I found this;
(defun c:test (/ ds dsnm tts ts mlsn result dict doc mlsdict mls tc lc co) (vl-load-com) (setq ds (getvar "dimscale")) ;Get Dimscale (setq dsnm (rtos ds 2 0)) ;Turns Dimscale into String for MLeaderStyle Name (setq tts (getvar "textsize")) ;Retrieve Current Text Height (setq ts (/ tts ds)) ;Divides the Current Text Height By the Dimscale to get the plotted text height (setq mlsn (strcat "CEI - " dsnm " Arrow")) ;Creates MLeaderStyle CEI [dimscale] Arrow (setq result "NO") (if (setq dict (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE")) ;Checks to see if MLeaderStyle exists (foreach x dict (if (and (= (car x) 3) (eq (strcase (cdr x)) (strcase mlsn))) (setq result "YES")))) (if (= result "NO")(progn (setq doc (vla-get-activedocument (vlax-get-acad-object))) (setq mlsdict (vla-item (vla-get-dictionaries doc) "ACAD_MLEADERSTYLE")) (setq mls (vlax-invoke mlsdict 'addobject mlsn "AcDbMLeaderStyle")) (setq tc 2) (setq lc 1) (setq co (vla-getinterfaceobject (vlax-get-acad-object) "AcadAcCmColor")) (vla-put-ColorIndex co tc) (vla-put-TextColor mls co) (vla-put-ColorIndex co lc) (vla-put-LeaderLineColor mls co) (vlax-put-property mls 'AlignSpace 0.18) (vlax-put-property mls 'Annotative 0) (vlax-put-property mls 'ArrowSize 0.125) (vlax-put-property mls 'BlockConnectionType 0) (vlax-put-property mls 'BlockRotation 0.0) (vlax-put-property mls 'BlockScale 1.0) (vlax-put-property mls 'BreakSize 0.0625) (vlax-put-property mls 'ContentType 2) (vlax-put-property mls 'Description mlsn) (vlax-put-property mls 'DoglegLength 6.0) (vlax-put-property mls 'DrawLeaderOrderType 0) (vlax-put-property mls 'DrawMLeaderOrderType 1) (vlax-put-property mls 'EnableBlockRotation -1) (vlax-put-property mls 'EnableBlockScale -1) (vlax-put-property mls 'EnableDogleg -1) (vlax-put-property mls 'EnableFrameText 0) (vlax-put-property mls 'EnableLanding -1) (vlax-put-property mls 'FirstSegmentAngleConstraint 0) (vlax-put-property mls 'LandingGap 0.0625) (vlax-put-property mls 'LeaderLineType 1) (vlax-put-property mls 'LeaderLineTypeId "Continuous") (vlax-put-property mls 'LeaderLineWeight -1) (vlax-put-property mls 'MaxLeaderSegmentsPoints 9) (vlax-put-property mls 'name mlsn) (vlax-put-property mls 'ScaleFactor ds) (vlax-put-property mls 'SecondSegmentAngleConstraint 0) (vlax-put-property mls 'TextAlignmentType 1) (vlax-put-property mls 'TextAngleType 1) (vlax-put-property mls 'TextHeight ts) (vlax-put-property mls 'TextLeftAttachmentType 1) (vlax-put-property mls 'TextRightAttachmentType 1) (vlax-put-property mls 'TextString "") (vlax-put-property mls 'TextStyle "ROMANS"))) (command "._cmleaderstyle" mlsn) )
and it works, except I want to set the arrow head to Dot blank and I cannot figure out how to do it. Any help would be appreciated.
Solved! Go to Solution.