Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Variables for Mleader routine

3 REPLIES 3
Reply
Message 1 of 4
Raddis
574 Views, 3 Replies

Variables for Mleader routine

Almost there!

(vl-load-com)
(defun mlcreate (/ *doc* mldrdict newldrstyle)
(setq *doc* (vla-get-activedocument (vlax-get-acad-object)))
(setq mldrdict (vla-item (vla-get-dictionaries *doc*) "ACAD_MLEADERSTYLE"))
(setq newldrstyle (vlax-invoke mldrdict 'addobject "CGA" "AcDbMLeaderStyle"))
(setq txtcol 0 ldrcol 0)
(setq colorObj (vla-getinterfaceobject (vlax-get-acad-object) "AutoCAD.AcCmColor.17"))
(vla-put-ColorIndex colorObj txtcol)
(vla-put-ColorIndex colorObj ldrcol)
(vlax-put-property newldrstyle 'AlignSpace 5.0)
;; Leader format
;;; (vlax-put-property newldrstyle 'ArrowSymbol "Arrowhead")
(vlax-put-property newldrstyle 'ArrowSize 0.125)
(vlax-put-property newldrstyle 'BreakSize 0.0625)
(vlax-put-property newldrstyle 'LeaderLineType 1)
(vla-put-LeaderLineColor newldrstyle colorObj)
(vlax-put-property newldrstyle 'LeaderLineTypeId "Bylayer" )
(vlax-put-property newldrstyle 'LeaderLineWeight -2)
;; Leader Structure
(vlax-put-property newldrstyle 'MaxLeaderSegmentsPoints 2)
(vlax-put-property newldrstyle 'FirstSegmentAngleConstraint 0)
(vlax-put-property newldrstyle 'SecondSegmentAngleConstraint 0)
(vlax-put-property newldrstyle 'EnableLanding -1)
(vlax-put-property newldrstyle 'EnableDogleg -1)
(vlax-put-property newldrstyle 'DoglegLength -2.0)
(vlax-put-property newldrstyle 'Annotative 1)
;; Content
(vlax-put-property newldrstyle 'ContentType 2)
(vlax-put-property newldrstyle 'Description "CGA")
(vlax-put-property newldrstyle 'TextString "")
(vlax-put-property newldrstyle 'TextStyle "technical")
(vlax-put-property newldrstyle 'TextAngleType 1)
(vla-put-TextColor newldrstyle colorObj)
(vlax-put-property newldrstyle 'TextHeight 0.09375)
(vlax-put-property newldrstyle 'TextAlignmentType 0)
(vlax-put-property newldrstyle 'EnableFrameText 0)
(vlax-put-property newldrstyle 'TextLeftAttachmentType 1)
(vlax-put-property newldrstyle 'TextRightAttachmentType 5)
(vlax-put-property newldrstyle 'LandingGap 0.029296875)
(vlax-put-property newldrstyle 'DrawLeaderOrderType 0)
(vlax-put-property newldrstyle 'DrawMLeaderOrderType 1)
(vlax-put-property newldrstyle 'Description "CGA")
(vlax-put-property newldrstyle 'name "CGA")
)

By default, this routine uses the Closed filled arrowhead but i'm wondering what the correct code for the 'ArrowSymbol variable is to do this.
And, more importantly, I want the text content Always Left Justified, but the 'TextAlignmentType variable doesn't seem to do this.

All help is appreciated!!

Reid
3 REPLIES 3
Message 2 of 4
balisteor
in reply to: Raddis

For the Text Alignment type this works
( vla-put-TextAlignmentType newldrstyle 0 )

I Can't figure out the Arrowhead issue.
I just keep getting *Key not found* Error. : (
Message 3 of 4
Raddis
in reply to: Raddis

Same here.
Why is it so difficult to set a closed filled arrow!
Thanks
Message 4 of 4
Raddis
in reply to: Raddis

That (this) doesn't do anything for text alignment.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost