Does nyone know where the value of the "always left" justification checkbox in the multileader style dialog is stored? I would very much like to make sure this is set in all of my multileader styles but I cannot find anything that affects it other than opening the dialog and checking it.
The value for TextAlignmentType in my style object is always zero regardless of whether the "always left" justification checkbox is checked or not. Anyone know the answer?
My Multileader Style object dump:
; IAcadMLeaderStyle: AutoCAD MLeaderStyle Interface
; Property values:
; AlignSpace = 0.16667
; Annotative = 0
; Application (RO) = Exception occurred
; ArrowSize = 0.18
; ArrowSymbol = "DIMARO"
; BitFlags = 0
; Block = ""
; BlockColor = #<VLA-OBJECT IAcadAcCmColor 000000003cbc6c80>
; BlockConnectionType = 0
; BlockRotation = 0.0
; BlockScale = 1.0
; BreakSize = 0.125
; ContentType = 2
; Description = "Test7"
; Document (RO) = #<VLA-OBJECT IAcadDocument 0000000027582048>
; DoglegLength = 0.125
; DrawLeaderOrderType = 0
; DrawMLeaderOrderType = 1
; EnableBlockRotation = -1
; EnableBlockScale = -1
; EnableDogleg = -1
; EnableFrameText = 0
; EnableLanding = -1
; FirstSegmentAngleConstraint = 0
; Handle (RO) = "E28B"
; HasExtensionDictionary (RO) = 0
; LandingGap = 0.0625
; LeaderLineColor = #<VLA-OBJECT IAcadAcCmColor 000000003cbbb460>
; LeaderLinetype = 1
; LeaderLineTypeId = "ByBlock"
; LeaderLineWeight = -2
; MaxLeaderSegmentsPoints = 4
; Name = "Test7"
; ObjectID (RO) = 52
; ObjectID32 (RO) = 52
; ObjectName (RO) = "AcDbMLeaderStyle"
; OverwritePropChanged (RO) = -1
; OwnerID (RO) = 53
; OwnerID32 (RO) = 53
; ScaleFactor = 0.0
; SecondSegmentAngleConstraint = 0
; TextAlignmentType = 0
; TextAngleType = 1
; TextAttachmentDirection = 0
; TextBottomAttachmentType = 0
; TextColor = #<VLA-OBJECT IAcadAcCmColor 000000003cbbca20>
; TextHeight = 0.11
; TextLeftAttachmentType = 1
; TextRightAttachmentType = 5
; TextString = ""
; TextStyle = "Standard"
; TextTopAttachmentType = 0
Solved! Go to Solution.
Solved by Lee_Mac. Go to Solution.
Having only drilled through the ACAD_MLEADERSTYLE Dictionary, the MLeaderStyle Type's TextAlignAlwaysLeft Property has not been exposed to Visual LISP... It may have been exposed to vanilla LISP's various Dict* functions via entity data, otherwise you'll have to step up into the .NET API.
HTH
Screen shot from Object Browser (Visual Studio):
"How we think determines what we do, and what we do determines what we get."
Not tested, but maybe something like this
(defun c:test (/ mls mlss mls_d) (if (and (setq mls_d (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE")) (setq mlss (vl-remove-if-not '(lambda (x) (= 350 (car x))) mls_d)) );; and (foreach x mlss (setq mls (entget (cdr x))) (entmod (subst (cons 297 1) (assoc 297 mls) mls)) );; foreach );; if (princ) );; test
HTH
Henrique
Slight mod....
(defun c:MLeaderAlignAlwaysLeft (/ data) (foreach mleaderStyle (vl-remove-if-not (function (lambda (x) (= 350 (car x))) ) (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE") ) (entmod (subst (cons 297 1) (assoc 297 (setq data (entget (cdr mleaderStyle)))) data ) ) ) (princ) )
Cheers
"How we think determines what we do, and what we do determines what we get."
Keeping things Vanilla, you could also use dictnext, e.g.:
(defun c:mlsleft ( / dic itm ) (if (setq dic (cdr (assoc -1 (dictsearch (namedobjdict) "ACAD_MLEADERSTYLE")))) (while (setq itm (dictnext dic (null itm))) (entmod (subst '(297 . 1) (assoc 297 itm) itm)) ) ) (princ) )
Sorry for the delay in acknowledging your excellent solution. I've been alternately sick and then very busy.
Thank you very much.
No problem at all - I hope you are feeling better now