Leader formatting
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Leader formatting

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
juno
Guest





Posted: Thu Mar 17, 2005 3:19 am    Post subject: Leader formatting Reply with quote

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

Back to top
Jürg Menzi
Guest





Posted: Thu Mar 17, 2005 10:04 am    Post subject: Re: Leader formatting Reply with quote

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
--
Juerg Menzi
MENZI ENGINEERING GmbH, Switzerland
http://www.menziengineering.ch
Back to top
juno
Guest





Posted: Thu Mar 17, 2005 10:15 pm    Post subject: Re: Leader formatting Reply with quote

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

Back to top
Jürg Menzi
Guest





Posted: Fri Mar 18, 2005 1:03 am    Post subject: Re: Leader formatting Reply with quote

Hi juno

Glad to help you...¦-)

Cheers
--
Juerg Menzi
MENZI ENGINEERING GmbH, Switzerland
http://www.menziengineering.ch
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Windows Server DSP VoIP Electronics New Topics
Powered by phpBB