Leader formatting

Discussion in 'AutoCAD' started by juno, Mar 16, 2005.

  1. juno

    juno Guest

    Is their a way to set up the leader (leader setting) via VBA so that I can use it their after (_qleader)?

    I would greatly appreciate any help
     
    juno, Mar 16, 2005
    #1
  2. juno

    Jürg Menzi Guest

    Hi Juno

    Can't help with VBA, but the following LISP sample is easy to translate:
    Code:
    (defun MeGetQleader ( / CurDic CurItm RetVal)
    (if (setq CurDic (dictsearch (namedobjdict) "AcadDim"))
    (progn
    (foreach memb '(3 40 60 61 62 63 64 65 66 67 68 69 70 71 72 170 340)
    (if (setq CurItm (assoc memb CurDic))
    (setq RetVal (cons CurItm RetVal))
    )
    )
    (reverse RetVal)
    )		;-Group codes for settings:
    '((3 . "")	; User arrowhead block name (default="")
    (40 . 0.0)	; Default text width (default=0.0)
    (60 . 0)	; Annotation type (default=0):
    ;  0=MText
    ;  1=Copy object
    ;  2=Tolerance
    ;  3=Block
    ;  4=None
    (61 . 0)	; Annotation reuse (default=0):
    ;  0=Off
    ;  1=On
    (62 . 1)	; Left attachment point (default=1):
    ;  0=Top of top line
    ;  1=Middle of top line
    ;  2=Middle of multiline text
    ;  3=Middle of bottom line
    ;  4=Bottom of bottom line
    (63 . 3)	; Right attachment point (default=3):
    ;  0=Top of top line
    ;  1=Middle of top line
    ;  2=Middle of multiline text
    ;  3=Middle of bottom line
    ;  4=Bottom of bottom line
    (64 . 0)	; Underline bottom line (default=0):
    ;  0=Off
    ;  1=On
    (65 . 0)	; Use splined leader line (default=0):
    ;  0=Off
    ;  1=On
    (66 . 0)	; No limit on points (default=0):
    ;  0=Off
    ;  1=On
    (67 . 3)	; Maximum number of points (default=3)
    (68 . 1)	; Prompt for MText width (word wrap) (default=1):
    ;  0=Off
    ;  1=On
    (69 . 0)	; Always left justify (default=0):
    ;  0=Off
    ;  1=On
    (70 . 0)	; Allowed angle, first segment (default=0):
    ;  0=Any angle
    ;  1=Horizontal
    ;  2=90°
    ;  3=45°
    ;  4=30°
    ;  5=15°
    (71 . 1)	; Allowed angle, second segment (default=0):
    ;  0=Any angle
    ;  1=Horizontal
    ;  2=90°
    ;  3=45°
    ;  4=30°
    ;  5=15°
    (72 . 0)	; Frame text (default=0):
    ;  0=Off
    ;  1=On
    (170 . 0)	; Active tab for settings (default=0):
    ;  0=Annotation
    ;  1=Leader Line & Arrow
    ;  2=Attachment
    ;   (340 . ID)	; Object ID for annotation reuse
    )
    )
    )
    ;
    ; -- Qleader Dictionary setzen
    ;
    (defun MeSetQleader (Lst / DicLst)
    (dictremove (namedobjdict) "AcadDim")
    (setq DicLst (append
    '((0 . "XRECORD") (100 . "AcDbXrecord") (90 . 990106))
    Lst
    )
    )
    (dictadd (namedobjdict) "AcadDim" (entmakex DicLst))
    (princ)
    )
    
    Cheers
     
    Jürg Menzi, Mar 17, 2005
    #2
  3. juno

    juno Guest

    Juerg, thank you ,thank you ,thank you!!!!!!!!! :)))))))))

    I tried looking up “dictionaries†in VBA books but would get a “beyond the scope of this bookâ€. The documentation that Auto Desk provides in the help files are very broad and lead to nowhere. When I got the 2005 version I was under the impression that the VB aspect of the software would have been developed in order for users to abdicate programming languages like Lisp. But just as I start embarking on such notion I run into a wall and Lisp comes to my rescue.

    Again, thank Juerg for your help this is exactly what I was looking for. I can always use SendCommand in VBA to send Lisp arguments.

    -Juno
     
    juno, Mar 17, 2005
    #3
  4. juno

    Jürg Menzi Guest

    Hi juno

    Glad to help you...¦-)

    Cheers
     
    Jürg Menzi, Mar 17, 2005
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.