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

Multileader Style Justification always left

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
coopdetat
1478 Views, 10 Replies

Multileader Style Justification always left

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

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989

Windows 10 Pro 64-bit Intel﴾R﴿ Core﴾TM﴿ i9-12900KF CPU 3.19GHz; 32 GB DDR4 4266 Dual Channel RAM
nVidia Quadro RTX 4000; AutoCAD Civil 3D 2023.2.1 Update
10 REPLIES 10
Message 2 of 11
BlackBox_
in reply to: coopdetat

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):

 

adsk.object.browser.mleaderstyle.textalignalwaysleft.png



"How we think determines what we do, and what we do determines what we get."

Message 3 of 11
hmsilva
in reply to: coopdetat

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

EESignature

Message 4 of 11
BlackBox_
in reply to: hmsilva

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."

Message 5 of 11
Lee_Mac
in reply to: BlackBox_

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)
)

 

Message 6 of 11
BlackBox_
in reply to: Lee_Mac

Nicely done.



"How we think determines what we do, and what we do determines what we get."

Message 7 of 11
hmsilva
in reply to: BlackBox_

@ BlackBox

nice modification!

 

@ Lee Mac,

nice approach, using the dictnext!

 

Henrique

EESignature

Message 8 of 11
Lee_Mac
in reply to: hmsilva

Message 9 of 11
BlackBox_
in reply to: hmsilva

Cheers, guys! :beer:



"How we think determines what we do, and what we do determines what we get."

Message 10 of 11
coopdetat
in reply to: Lee_Mac

Sorry for the delay in acknowledging your excellent solution.  I've been alternately sick and then very busy.

Thank you very much.

---------------------------------------------Signature--------------------------------------------
Civil Design Professional Since 1983 (Intergraph), AutoCAD since 1989

Windows 10 Pro 64-bit Intel﴾R﴿ Core﴾TM﴿ i9-12900KF CPU 3.19GHz; 32 GB DDR4 4266 Dual Channel RAM
nVidia Quadro RTX 4000; AutoCAD Civil 3D 2023.2.1 Update
Message 11 of 11
Lee_Mac
in reply to: coopdetat

No problem at all - I hope you are feeling better now Smiley Happy

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

Post to forums  

Autodesk Design & Make Report

”Boost