See the top rated post in this thread. Click here

Results 1 to 10 of 10

Thread: Is there a way to Automatically set the QLEADER defaults?

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

    Angry Is there a way to Automatically set the QLEADER defaults?

    Is there a way to Automatically set the QLEADER defaults? I have searched but could not find any system variables that define some QLEADER setings. Basically I am trying to get the QLEADER to default to ALWAYS JUSTIFY LEFT instead of PROMPT FOR WIDTH. If anyone know how I can set these in my ACAD.LSP file please let me know. RIght now I have to set them in EVERY drawing. There must be a way to make this happen globally.

  2. #2
    Wish List Manager BrenBren's Avatar
    Join Date
    2000-11
    Location
    150700
    Posts
    3,439
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    You can set them in your template drawing. This is the drawing that AutoCAD opens every time you start a new drawing.

  3. #3
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    1

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    Hi

    Give the following a try, comes from an old LISP Guild post by Robert Bell -

    Here is an alternative function that does not require an external file
    (written by one of the Express Tools team):
    Code:
    ;|
    qlset.lsp - example initialization of QLEADER settings
    Frank Whaley, Autodesk
    
    Two functions are included in this file: 
    
    (acet-ql-get)
    Returns an association list containing the current QLEADER settings from the
    Named Object Dictionary.
    
    (acet-ql-get <alist>)
    Sets the specified values for QLEADER settings from the given association
    list.
    Returns an association list containing the new values.
    
    These functions can be used to examine the current QLEADER settings, or to
    initialize the setting before using the QLEADER command.
    For example, to use splined leaders and framed text:
    
    (acet-ql-set '((65 . 1)(72 . 1)))
    
    Both functions use the following group codes to identify QLEADER settings:
    
      3: user arrowhead block name (default="")
     40: default text width (default=0.0)
     60: annotation type (default=0)
    	 0=MText
    	 1=copy object
    	 2=Tolerance
    	 3=block
    	 4=none
     61: annotation reuse (default=0)
    	 0=none
    	 1=reuse next
     62: left attachment point (default=1)
     63: 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: underline bottom line (default=0)
     65: use splined leader line (default=0)
     66: no limit on points (default=0)
     67: maximum number of points (default=3)
     68: prompt for MText width (word wrap) (default=1)
     69: always left justify (default=0)
     70: allowed angle, first segment (default=0)
     71: allowed angle, second segment (default=0)
    	 0=Any angle
    	 1=Horizontal
    	 2=90deg
    	 3=45deg
    	 4=30deg
    	 5=15deg
     72: frame text (default=0)
    170: active tab (default=0)
    	 0=Annotation
    	 1=Leader Line & Arrow
    	 2=Attachment
    340: object ID for annotation reuse
    
    |;
    
    (defun acet-ql-get (/ xr cod itm reply)
      (if (setq xr (dictsearch (namedobjdict) "AcadDim"))
    	(progn
    	  (foreach cod
    		'(3 40 60 61 62 63 64 65 66 67 68 69 70 71 72 170 340)
     (if (setq itm (assoc cod xr))
       (setq reply (append reply (list itm)))
     )
    	  )
    	  reply
    	)
    	'((3 . "")
    	  (40 . 0.0)
    	  (60 . 0)
    	  (61 . 1)
    	  (62 . 1)
    	  (63 . 3)
    	  (64 . 0)
    	  (65 . 0)
    	  (66 . 0)
    	  (67 . 3)
    	  (68 . 1)
    	  (69 . 0)
    	  (70 . 0)
    	  (71 . 0)
    	  (72 . 0)
    	  (170 . 0)
    	 )
      )
    )
    
    (defun acet-ql-set (arg / cur prm)
      ;;  fetch current
      (setq cur (acet-ql-get))
    
      ;;  override per argument
      (while arg
    	(setq prm (car arg)
       arg (cdr arg)
       cur (subst prm (assoc (car prm) cur) cur)
    	)
    	;;  handle DIMLDRBLK
    	(if (= 3 (car prm))
    	  (setvar "DIMLDRBLK" (cdr prm))
    	)
      )
    
      ;;  put back
      (dictremove (namedobjdict) "AcadDim")
      (setq
    	cur (append '((0 . "XRECORD") (100 . "AcDbXrecord") (90 . 990106))
      cur
     )
      )
      (dictadd (namedobjdict) "AcadDim" (entmakex cur))
    
      (acet-ql-get)
    )
    
    ;;  load quietly
    (princ)

    R. Robert Bell, MCSE
    AUGI Guild Moderator
    www.AcadX.com

    ************

    Have a good one, Mike

  4. #4
    Member
    Join Date
    2004-09
    Posts
    18
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    Can you elaborate on how to set this in the drawing template? thanks

    Quote Originally Posted by BrenBren
    You can set them in your template drawing. This is the drawing that AutoCAD opens every time you start a new drawing.

  5. #5
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    1

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    open a blank drawing, start the QLEADER command, change your settings, draw a leader, erase it, and save the drawing as a DWT file

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    Quote Originally Posted by vpoon
    Can you elaborate on how to set this in the drawing template? thanks
    Run the OPEN command.
    In the "Files of Type" drop-down, choose .DWT (Template Files)
    Choose your template file from the list to open it
    Change your QLEADER settings, and anything else that needs to be set.
    Save, and close.

    If you are using 2006, you can make this the default template by changing the appropriate setting is OPTIONS. Then the QNEW command will use this.

    For earlier versions, just select this template when you start a new drawing.

    You only need to follow ccowgill's advise above if you do not have any templates.
    R.K. McSwain | CAD Panacea |

  7. #7
    The Silent Type Mike.Perry's Avatar
    Join Date
    2000-11
    Posts
    13,656
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    Quote Originally Posted by rkmcswain
    If you are using 2006, you can make this the default template by changing the appropriate setting is OPTIONS. Then the QNEW command will use this.
    Hi

    Side note, _.QNew first appeared in AutoCAD 2004 [ ID: TP00152 - Quickly start a new drawing ].

    Have a good one, Mike
    Last edited by Mike.Perry; 2007-05-23 at 06:40 AM. Reason: Link updated.

  8. #8
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,805
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    Quote Originally Posted by Mike.Perry
    Side note, _.QNew first appeared in AutoCAD 2004
    Good catch. This 12 month release schedule sort of melts the command sets together..... especially when you don't install each release.
    R.K. McSwain | CAD Panacea |

  9. #9
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,421
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    Attached is a copy of the code saved as a lisp file.
    Attached Files Attached Files
    C:> ED WORKING....


    LinkedIn

  10. #10
    Active Member
    Join Date
    2005-05
    Posts
    64
    Login to Give a bone
    0

    Default Re: Is there a way to Automatically set the QLEADER defaults?

    I used the lisp routing previously to establish my qleader settings with much success. Now that 2008 has the mleader, does anyone have any sense of how to go about doing this same thing with the mleader settings? Is it another list or are there variables associated with the mleader style similar to dimstyles??

Similar Threads

  1. Customizing Qleader
    By tsamuel in forum AutoCAD Customization
    Replies: 2
    Last Post: 2005-05-25, 01:03 PM
  2. Qleader
    By robert.1.hall72202 in forum AutoCAD General
    Replies: 4
    Last Post: 2005-03-04, 11:22 PM
  3. Qleader
    By robert.1.hall72202 in forum AutoCAD Customization
    Replies: 4
    Last Post: 2004-11-12, 11:52 PM
  4. QLeader Colours
    By mesmvcole in forum AutoCAD General
    Replies: 7
    Last Post: 2004-10-04, 05:54 PM
  5. Setting qleader defaults
    By jwf in forum AutoLISP
    Replies: 3
    Last Post: 2004-08-05, 08:07 PM

Posting Permissions

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