See the top rated post in this thread. Click here

Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Creating Multileader Style using LISP

  1. #11
    Member
    Join Date
    2010-09
    Posts
    43
    Login to Give a bone
    0

    Default Re: Creating Multileader Style using LISP

    Quote Originally Posted by fixo View Post
    I just slightly tweaked this code,
    see if this will works
    So I tried your code and it works as written. I tried modifying it to suit my needs. I removed two arguments (leader and text color. I added one argument, MLDScale. This creates the MLD style but the scale goes crazy. so I'll input as follows

    Code:
    (make_mleader_style "test" 10.0)
    When I check the mstyle it says the scale factor is 1877221544.0. I have no idea what I'm doing wrong. Here is the modified code

    Code:
    ;; original code by VVA
    (defun make_mleader_style	(mleaderstylename
    				 MLDScale                            ;;added/removed arguments
    				 /
    				 adoc
    				 mldrdict
    				 newldrstyle
    				 objcolor
    				)
      (vl-load-com)
      (setq adoc (vla-get-activedocument (vlax-get-acad-object)))
      (setq	mldrdict
    	 (vla-item (vla-get-dictionaries adoc) "ACAD_MLEADERSTYLE")
      ) ;_ end of setq
      (setq	newldrstyle
    	 (vlax-invoke
    	   mldrdict
    	   'addobject
    	   mleaderstylename
    	   "AcDbMLeaderStyle"
    	 ) ;_ end of vlax-invoke
      ) ;_ end of setq
      (setq	objcolor (vla-getinterfaceobject
    		   (vlax-get-acad-object)
    		   (strcat "AutoCAD.AcCmColor."
    			   (substr (getvar "acadver") 1 2)
    		   ) ;_ end of strcat
    		 ) ;_ end of vla-getinterfaceobject
      ) ;_ end of setq                                           ;;this is where I override the colors
      (vla-put-colorindex objcolor 2)                       ;;I really don't know what's going on here. i"m trying to understand
      (vla-put-textcolor newldrstyle objcolor)
      (vla-put-colorindex objcolor 0)
      (vla-put-leaderlinecolor newldrstyle objcolor)
    
    
      (foreach item
    	   (list
    	     '("AlignSpace" 4)
    	     '("ArrowSize" 0.125)
    	     '("BitFlags" 0)
    	     '("BlockConnectionType" 1)
    	     '("BlockRotation" 0.0)
    	     '("BlockScale" 1.0)
    	     '("BreakSize" 0.125)
    	     '("ContentType" 2)		;mtext
    	     '("Description" "My Style Description")
    	     '("DoglegLength" 1.25)
    	     '("DrawLeaderOrderType" 0)
    	     '("DrawMLeaderOrderType" 1)
    	     '("EnableBlockRotation" -1)
    	     '("EnableBlockScale" -1)
    	     '("EnableDogleg" -1)
    	     '("EnableFrameText" 0)
    	     '("EnableLanding" -1)
    	     '("FirstSegmentAngleConstraint" 0)
    	     (list "LandingGap"
    		   (vla-get-landinggap (vla-item mldrdict "Standard"))
    	     ) ;_ end of list
    	     '("LeaderLineType" 1)
    	     '("LeaderLineTypeId" "ByLayer")
    	     '("LeaderLineTypeId" "ByLayer")
    	     '("LeaderLineWeight" -3)
    	     '("MaxLeaderSegmentsPoints" 2)
    	     '("ScaleFactor" MLDScale)                         ;;This is where I added the argument MLDScale
    	     '("SecondSegmentAngleConstraint" 0)
    	     '("TextAlignmentType" 0)
    	     '("TextAngleType" 0)
    	     '("TextHeight" 1.5)
    	     '("TextLeftAttachmentType" 4) ;original 3
    	     '("TextRightAttachmentType" 4);original 3
    	     '("TextString" "Default\\PText")
    	     '("TextStyle" "STANDARD")
    	   ) ;_ end of list
    
        (vlax-put newldrstyle (car item) (cadr item))
      ) ;_ end of foreach
      newldrstyle
    ) ;_ end of defun

  2. #12
    Woo! Hoo! my 1st post
    Join Date
    2018-03
    Posts
    1
    Login to Give a bone
    0

    Default Re: Creating Multileader Style using LISP

    I tried using the code and it works butit sets the arrow size to be 0. How to I change it to change the arrow size to be something else and also to set the color to be bylayer rather than a specific color?

Page 2 of 2 FirstFirst 12

Similar Threads

  1. MULTILEADER STYLE
    By Moubis106433 in forum AutoCAD General
    Replies: 4
    Last Post: 2015-07-10, 02:09 AM
  2. changing multileader style
    By Peter Sedlacek in forum AutoCAD Annotation
    Replies: 5
    Last Post: 2012-02-06, 01:58 PM
  3. Modify Multileader Style - Help please
    By john.lincoln in forum AutoCAD General
    Replies: 4
    Last Post: 2008-12-29, 10:53 PM
  4. Multileader Style Change...
    By sevenDeuce in forum AutoCAD Annotation
    Replies: 5
    Last Post: 2008-09-11, 06:30 PM
  5. Multileader style location?
    By Steve_Bennett in forum AutoCAD Annotation
    Replies: 5
    Last Post: 2007-05-15, 06:51 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •