Jump to content

Search the Community

Showing results for 'qlset'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 14 results

  1. tombu

    Qleader lisp routine

    Problem is the number of pauses you need is dependant on the current qleader settings. Frank Whaley at Autodesk created qlset.lsp that can set any qleader settings to fit whatever you want to do with your qleader lisp and reset those settings afterwards if you wish. I've attached qlset.lsp and lead.lsp I wrote years ago as an example you can modify to suit your needs. I'd suggest reading Frank Whaley's code first to see all it can do. If you search for qlset.lsp you'll find many other examples. lead.lsp qlset.lsp
  2. You need the qlset.lsp to change or account for leader settings in your lisp. The CADTutor search below should help. https://www.cadtutor.net/forum/search/?q=qlset Search on AUTODESK KNOWLEDGE NETWORK below. https://forums.autodesk.com/t5/forums/searchpage/tab/message?advanced=false&allow_punctuation=false&filter=location&location=category:8&q=qlset.lsp
  3. tombu

    Leader with Text

    You're going to need qlset.lsp by Frank Whaley at Autodesk to modify QLEADER settings. Examples can be found: https://www.cadtutor.net/forum/topic/12508-qleader-lisp/ Many more examples if you search for qlset.lsp, this lisp has been around for a while.
  4. There are 14 different settings that affect options for the qleader command. For a lisp to work consistently for multiple users you would need to set the options for number of vertices and either text or mtext using the qlset.lsp by Frank Whaley at Autodesk. It's been posted on this forum many times already: https://www.cadtutor.net/forum/search/?q=qlset I'd recommend resetting those settings at the end of the lisp to avoid upsetting another user whose settings aren't exactly the same as yours.
  5. tombu

    qleader lisp

    I don't have the "acad-push-dbmod" in my version of "qlset.lsp" shouldn't that be in ( )? That lisp needs to be used in any lisp that uses the qleader command as it's the only way it will work for other users with different settings. Example: (defun c:lead ( / *error* curlay) (defun *Error* (msg) ; embedded defun (setvar "clayer" clay) (acet-ql-set (list(cons 67 vrtcs))) ;reset maximum # of points to previous value (if (/= s "Function cancelled") (princ (strcat "\nError: " msg)) ) (princ) ) (or acet-ql-get (load "qlset.lsp")) (setvar "cmdecho" 0) (setq curlay (getvar "clayer")) (if (= (tblsearch "layer" "dim") nil)(command "layer" "n" "dim" "c" 6 "" "")) ;New not Make (command "layer" "s" "dim" "") ;change to "dimen" layer (command "ortho" "off") (setq vrtcs (cdr(assoc 67(acet-ql-get)))) (acet-ql-set '((67 . 2))) ;set maximum # of points to 2 (princ "Specify leader start point:") (if(= 1(cdr(assoc 68(acet-ql-get)))); prompt for MText width (word wrap) (default=1) (command "qleader" PAUSE PAUSE "0") (command "qleader" PAUSE PAUSE) ) (while (= 1 (logand 1 (getvar "cmdactive"))) (command (getstring T "Enter Leader Text: ")) ) ;null responce exits text (command "layerp") ;change back to previous layer (setvar "clayer" curlay) (setq TextObj (entlast)) (setq EnTyp (cdr (assoc 0 (entget TextObj)))) (setq vlText (vlax-ename->vla-object TextObj)) (vlax-put-property vlText 'backgroundfill :vlax-true) ; background mask (acet-ql-set (list(cons 67 vrtcs))) ;reset maximum # of points to previous value (princ) )
  6. tombu

    Points of leader

    Use the lisp function MEMBER It searches a list for an occurrence of an expression and returns the remainder of the list, starting with the first occurrence of the expression so: (defun C:test (/ e pt p2 p3) (setq pt(nentsel (strcat "\n Select a leader < exit > : ")) e (entget (car pt));;association list of entity e (member (assoc 10 e) e) p1 (cdr (assoc 10 e));; cdr removes the 10 leaving the coordinates. e (cdr e) p2 (cdr (assoc 10 e)) e (cdr e) p3 (cdr (assoc 10 e)) ) (princ "\np1=")(princ p1)(princ ", p2=")(princ p2)(princ ", p3=")(princ p3)(princ) ) should return what you're looking for. You may want to search for qlset.lsp by Frank Whaley who worked for Autodesk. This code allows you to examine the current QLEADER settings, or to initialize the setting before using the QLEADER command. It can tell you how many points the leader has for example. Not everyone uses the default settings.
  7. tombu

    QLeader Lisp

    Not sure what you're asking for. If it's a lisp to modify qleader settings to draw the leader by picking two points that's easily done calling qlset.lsp by Frank Whaley at Autodesk which you can search for in this Forum. Numbering and adding those outlines would be more work.
  8. tombu

    Sos.....

    Start command, click [settings] or Enter, then click 'Leader Line & Arrow' tab, and modify Maximum Number of Points. To do it with lisp use the qlset.lsp. See http://www.cadtutor.net/forum/showthread.php?38397-qleader-lisp
  9. ReMark

    Quick leader with DOT arrowhead

    Couldn't you just as easily edit the default setting for QLeader (Leader line and arrow) in your drawing template file ensuring you'll always have it at the ready when you start a new drawing? If you really want to do this via code then see the lisp routine (qlset.lsp) by Lee Mac in post #8 of this thread... http://www.cadtutor.net/forum/showthread.php?38397-qleader-lisp
  10. So I'm posting this after reading through 14 pages of posts on "leader" and as well as numerous other sites..I've learned and found a few cool things but nothing on what I was hoping for..Basically, our company likes to uses a closed, spline, no limit points, any angle constraints, 6" arrow, on "str-txt" layer, center justification, with middle of multi line text on both sides of text. Any suggestions at all on drawing a single entity leader that posts the predefined mtext or text next to it. Basically, actually precisely an mleader w/ the auto text insertion..We have maybe 15 very frequently used header/beams text blocks we use to drag and drop to a qleader we drew and it just seems like a lisp could make the process so much more productive, less repetative..and less sloppy. If I missed a any valuable post, PLEASE let me know.. On my quest I've come across a few lisps but I think their for an auto configuration of the qleader settings?? (below) though would probably need to call from lisp I also ran across the dynamic intelligent leader which was very cool, and the attached lisp that I loved..by Ken Jolly. It draws a curved leader with pop up box of predefined text..Good way to save tool palette space! Its the closest thing I found to auto text. Thanks again for any help! ;;; qlset.lsp - example initialization of QLEADER settings ;;; Frank Whaley, Autodesk ;;; ;;; Two functions are included in this file: ;;; ;;; (acet-ql-Set) ;;; 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 ;;; ;;; |; acad-push-dbmod (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 . "none") (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)) ;Example Usage (acet-ql-set '((3 . "_Open30") (40 . 0.0) (60 . 4) ; No Annotation (61 . 0) ; No re-use (62 . 1) (63 . 3) (64 . 0) (65 . 0) ; Not splined (66 . 0) (67 . 3) ; Three point Leader (68 . 0) ; No MT width prompt (69 . 0) (70 . 3) ; 45deg restriction (71 . 1) ; Horizontal (72 . 0) (170 . 0))) (princ) (defun test (/) (dictremove (namedobjdict) "ACADDIM") (entmod (append (entget (namedobjdict)) (list (cons 3 "ACADDIM") (cons 350 (entmakex '((0 . "XRECORD") (100 . "AcDbXrecord") (280 . 1) (90 . 990106) (3 . "") (60 . 3) (61 . 0) (62 . 1) (63 . 3) (64 . 0) (65 . 0) (66 . 1) (67 . 3) (68 . 1) (69 . 0) (70 . 3) ;45 (71 . 3) ;45 (72 . 0) (40 . 0.0) (170 . 0) ) ) ) ) ) ) ) (defun c:scaleleader () (setq scale (getreal "Input current scale : ")) (setvar "osmode" 0) ; osnap off (setvar "DIMCLRE" ;Color (setvar "DIMCLRD" ;Color (setvar "DIMCLRT" ;Color (setvar "DIMZIN" 0) ;Trailing (command "STYLE" "2D" "vnsimple" "0" "0.9" "0" "N" "N" "N") (setvar "DIMEXE" (* 0.75 scale)) ;Extension above line (setvar "DIMEXO" (* 0.5 scale)) ;Feature offset (setvar "DIMASZ" (* 1 scale)) ;Arrow size (setvar "DIMBLK" ".") (setvar "DIMBLK2" ".") (setvar "DIMLDRBLK" ".") (setvar "DIMTSZ" 0) ;= 0 Draws arrowheads ;(setvar "DIMTSZ" (* 0.75 scale)) ;= 0 Draws arrowheads ; >0 Draws oblique strokes instead of arrowheads ;(setvar "DIMTSZ" (* 0.5 scale)) ;Tick size 0.7 (setvar "DIMTXT" (* 2.0 scale)) ;Text height 2.5 (setvar "DIMTAD" 1) ;Verical (defauft) (setvar "DIMTIH" 0) ;Horizontal (setvar "DIMTOH" 0) ;Horizontal (setvar "DIMTIX" 1) ;Force text inside (setvar "DIMSOXD" 0) ;Force text inside (setvar "DIMDEC" 2) ; (setvar "DIMSCALE" 0) ; (setvar "DIMGAP" (* 1 scale)) ; ;(setvar "DIMTXSTY" "2D") (setvar "DIMLFAC" 1) (setvar "DIMFIT" 5) ;No Leader (setvar "DIMSE1" 0) ;Suppress (setvar "REGENMODE" 1) (setvar "DIMAUNIT" 1) ;Degrees/minutes/seconds ) CHAN.DCL NOTE.LSP
  11. Lee Mac

    Qleader System Variables

    The settings are stored in a dictionary, you can set them like this: ;;; qlset.lsp - example initialization of QLEADER settings ;;; Frank Whaley, Autodesk ;;; ;;; Two functions are included in this file: ;;; ;;; (acet-ql-Set) ;;; 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 ;;; ;;; |; acad-push-dbmod (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) Or you can entmake the leader and put your overrides in the xData (-3) DXF codes: (entmake (list (cons 0 "LEADER") (cons 100 "AcDbEntity") (cons 100 "AcDbLeader") (cons 71 1) (cons 72 0) (cons 73 3) (cons 74 0) (cons 75 0) (cons 10 pt) (cons 10 pt1) (cons 10 (getpoint pt1 "\nSpecify Next Point")) (list -3 (list "ACAD" (cons 1000 "DSTYLE") (cons 1002 "{") (cons 1070 41) (cons 1040 2.5) (cons 1002 "}"))))) The information for such groups codes can be found here: Art Cooney (artc@autodesk.com) There's a description of the codes in the ObjectARX documentation (I've included it below). I don't think the DXF documentation explains the overrides. Here's the description from the ObjectARX docs: Dimension style overrides can be applied to any of the AcDbEntity types that reference an AcDbDimStyleTableRecord. These are: AcDbAlignedDimension AcDbRotatedDimension AcDbDiametricDimension AcDbRadialDimension AcDb2LineAngularDimension AcDb3PointAngularDimension AcDbOrdinateDimension AcDbLeader AcDbFcf Dimension overrides applied to an object of any of these classes are stored as xdata under the "ACAD" appId in a special subsection. The subsection starts with a group code 1000 (AcDb::kDxfXdAsciiString) with the string "DSTYLE", followed by all the dimension override data bracketed inside a pair of group code 1002's (AcDb::kDxfXdControlString) (the first being a "{" and the other a "}"). Dimension variables in general are called dimvars, and this data is commonly called "per-entity dimvar overrides" or just dimvar overrides. Within the group code 1002 brackets is a chain of dimvar group-code/data-value resbuf pairs, one pair for each dimvar being overridden. The first resbuf in each pair is the DXF group code for the dimvar, as found in the Table below. Since the group code is an integer it has a restype of AcDb::kDxfXdInteger16 (group code 1070). The second resbuf in each pair is the value for that dimvar. Data values for dimvars may be strings, integers, reals, or objectIds. As with resbufs in general, the value of the resbuf’s restype indicates how to read the data in the resval. Please refer to the Table below. As an example, here is a dimension style override list that will override the DIMTAD and DIMGAP variables. The list is shown in AutoLISP format with indenting for clarity. ("ACAD" (1000 . "DSTYLE") (1002 . "{") (1070 . 77) (1070 . 1) (1070 . 147) (1000 . 0.2) (1002 . "}") ) In this example the group code 77 is DIMTAD, which is overridden to be 1. Then DIMGAP (group code 147) is set to 0.2. The following code sample uses acutBuildList() to create this resbuf chain and to set overrides for DIMTAD and DIMGAP on the entity pointed to by pEnt, assuming pEnt points to an AcDbEntity of one of the types listed above and is open for writing: resbuf* pRb = acutBuildList( AcDb::kDxfRegAppName, "ACAD", AcDb::kDxfXdAsciiString, "DSTYLE", AcDb::kDxfXdControlString, "{", AcDb::kDxfXdInteger16, 77, AcDb::kDxfXdInteger16, 1, AcDb::kDxfXdInteger16, 147, AcDb::kDxfXdReal, 0.2, AcDb::kDxfXdControlString, "}", RTNONE); Acad::ErrorStatus es = pEnt->setXdata(pRb); acutRelRb(pRb); It is very important the xdata you set onto an object have the proper sequence of resbufs. Each override must have both the DXF group code resbuf and the associated value resbuf. In addition, the value must be the correct data type (string, real, or int) and must be within the allowable range for that dimvar. If any of these conditions are not met, AutoCAD may terminate. Also, the 1000 "DSTYLE" and the following 1002 "{" "}" set must be present, and there must only be one set of all of these. Remember that xdata is obtained and replaced on a per-appId basis. To modify any dimension overrides, work with the complete list of xdata for the "ACAD" appId, which may have other data, including other dimension overrides. So, be sure to obtain whatever xdata may already be present for the "ACAD" appId (use the object's xData() method with the string "ACAD"). Add or remove only the dimension override information you need, making sure that if dimension override information already exists you don't duplicate any of the xdata that's already there (including the "DSTYLE" string and the 1002 "{" "}" bracket pairs). Place new overrides in between the existing 1002 bracket pair, and put the complete modified list back into the object via the object's setXData() method. If not done correctly, AutoCAD may terminate. Here is a table of all the DimStyleTableRecord dimvars, with their DXF group codes, data types, and value ranges: Group code Dimension variable Data type Value range 3 DIMPOST string any 4 DIMAPOST string any 40 DIMSCALE real >= 0.0 41 DIMASZ real >= 0.0 42 DIMEXO real >= 0.0 43 DIMDLI real >= 0.0 44 DIMEXE real >= 0.0 45 DIMRND real >= 0.0 46 DIMDLE real >= 0.0 47 DIMTP real >= 0.0 48 DIMTM real >= 0.0 71 DIMTOL int 0 = off, 1 = on 72 DIMLIM int 0 = off, 1 = on 73 DIMTIH int 0 = off, 1 = on 74 DIMTOH int 0 = off, 1 = on 75 DIMSE1 int 0 = off, 1 = on 76 DIMSE2 int 0 = off, 1 = on 77 DIMTAD int 0 - 3 78 DIMZIN int 0 - 15 79 DIMAZIN int 0 - 15 new 140 DIMTXT real >= 0.0 141 DIMCEN real any value 142 DIMTSZ real >= 0.0 143 DIMALTF real >= 0.0 144 DIMLFAC real >= 0.0 145 DIMTVP real >= 0.0 146 DIMTFAC real >= 0.0 147 DIMGAP real any value 148 DIMALTRND real >= 0.0 new 170 DIMALT int 0 = off, 1 = on 171 DIMALTD int >= 0 172 DIMTOFL int 0 = off, 1 = on 173 DIMSAH int 0 = off, 1 = on 174 DIMTIX int 0 = off, 1 = on 175 DIMSOXD int 0 = off, 1 = on 176 DIMCLRD int 0 - 256 177 DIMCLRE int 0 - 256 178 DIMCLRT int 0 - 256 179 DIMADEC int 0 - 8 new 271 DIMDEC int 0 - 8 272 DIMTDEC int 0 - 8 273 DIMALTU int 1 - 8 274 DIMALTTD int 0 - 8 275 DIMAUNIT int 0 - 4 276 DIMFRAC int 0 - 2 new 277 DIMLUNIT int 0 - 4 new 278 DIMDSEP int (char) any char new 279 DIMATMOVE int 0 - 2 new 280 DIMJUST int 0 - 4 281 DIMSD1 int 0 = off, 1 = on 282 DIMSD2 int 0 = off, 1 = on 283 DIMTOLJ int 0 - 2 284 DIMTZIN int 0 - 15 285 DIMALTZ int 0 - 15 286 DIMALTTZ int 0 - 15 288 DIMUPT int 0 = off, 1 = on 289 DIMATFIT int 0 - 3 new 340 DIMTXSTY objectId new 341 DIMLDRBLK objectId new 342 DIMBLK objectId new 343 DIMBLK1 objectId new 344 DIMBLK2 objectId new 371 DIMLWD int lineweights new 372 DIMLWE int lineweights new
  12. Lee Mac

    qleader lisp

    You could, of course, put something like this in your ACADDOC.lsp file to automatically set your leader settings on startup: ;;; qlset.lsp - example initialization of QLEADER settings ;;; Frank Whaley, Autodesk ;;; ;;; Two functions are included in this file: ;;; ;;; (acet-ql-Set) ;;; 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 ;;; ;;; |; acad-push-dbmod (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 . "none") (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)) ;Example Usage (acet-ql-set '((3 . "_Open30") (40 . 0.0) (60 . 4) ; No Annotation (61 . 0) ; No re-use (62 . 1) (63 . 3) (64 . 0) (65 . 0) ; Not splined (66 . 0) (67 . 3) ; Three point Leader (68 . 0) ; No MT width prompt (69 . 0) (70 . 3) ; 45deg restriction (71 . 1) ; Horizontal (72 . 0) (170 . 0))) (princ)
  13. Lee Mac

    Specifying a NULL object.

    Oh right - thanks. Just to add to this thread though - I did find a work around in the form of this LISP which alters the dictionary entry for the leader object (may be useful): [i][color=#990099];;; qlset.lsp - example initialization of QLEADER settings[/color][/i] [i][color=#990099];;; Frank Whaley, Autodesk[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; Two functions are included in this file:[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; (acet-ql-Set)[/color][/i] [i][color=#990099];;; Returns an association list containing the current QLEADER settings from the[/color][/i] [i][color=#990099];;; Named Object Dictionary.[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; (acet-ql-get <alist>)[/color][/i] [i][color=#990099];;; Sets the specified values for QLEADER settings from the given association[/color][/i] [i][color=#990099];;; list.[/color][/i] [i][color=#990099];;; Returns an association list containing the new values.[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; These functions can be used to examine the current QLEADER settings, or to[/color][/i] [i][color=#990099];;; initialize the setting before using the QLEADER command.[/color][/i] [i][color=#990099];;; For example, to use splined leaders and framed text:[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; (acet-ql-set '((65 . 1)(72 . 1)))[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; Both functions use the following group codes to identify QLEADER settings:[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; 3: user arrowhead block name (default="")[/color][/i] [i][color=#990099];;; 40: default text width (default=0.0)[/color][/i] [i][color=#990099];;; 60: annotation type (default=0)[/color][/i] [i][color=#990099];;; 0=MText[/color][/i] [i][color=#990099];;; 1=copy object[/color][/i] [i][color=#990099];;; 2=Tolerance[/color][/i] [i][color=#990099];;; 3=block[/color][/i] [i][color=#990099];;; 4=none[/color][/i] [i][color=#990099];;; 61: annotation reuse (default=0)[/color][/i] [i][color=#990099];;; 0=none[/color][/i] [i][color=#990099];;; 1=reuse next[/color][/i] [i][color=#990099];;; 62: left attachment point (default=1)[/color][/i] [i][color=#990099];;; 63: right attachment point (default=3)[/color][/i] [i][color=#990099];;; 0=Top of top line[/color][/i] [i][color=#990099];;; 1=Middle of top line[/color][/i] [i][color=#990099];;; 2=Middle of multiline text[/color][/i] [i][color=#990099];;; 3=Middle of bottom line[/color][/i] [i][color=#990099];;; 4=Bottom of bottom line[/color][/i] [i][color=#990099];;; 64: underline bottom line (default=0)[/color][/i] [i][color=#990099];;; 65: use splined leader line (default=0)[/color][/i] [i][color=#990099];;; 66: no limit on points (default=0)[/color][/i] [i][color=#990099];;; 67: maximum number of points (default=3)[/color][/i] [i][color=#990099];;; 68: prompt for MText width (word wrap) (default=1)[/color][/i] [i][color=#990099];;; 69: always left justify (default=0)[/color][/i] [i][color=#990099];;; 70: allowed angle, first segment (default=0)[/color][/i] [i][color=#990099];;; 71: allowed angle, second segment (default=0)[/color][/i] [i][color=#990099];;; 0=Any angle[/color][/i] [i][color=#990099];;; 1=Horizontal[/color][/i] [i][color=#990099];;; 2=90deg[/color][/i] [i][color=#990099];;; 3=45deg[/color][/i] [i][color=#990099];;; 4=30deg[/color][/i] [i][color=#990099];;; 5=15deg[/color][/i] [i][color=#990099];;; 72: frame text (default=0)[/color][/i] [i][color=#990099];;; 170: active tab (default=0)[/color][/i] [i][color=#990099];;; 0=Annotation[/color][/i] [i][color=#990099];;; 1=Leader Line & Arrow[/color][/i] [i][color=#990099];;; 2=Attachment[/color][/i] [i][color=#990099];;; 340: object ID for annotation reuse[/color][/i] [i][color=#990099];;; [/color][/i] [i][color=#990099];;; |;[/color][/i] [b][color=Blue]acad-push-dbmod[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] acet-ql-get [b][color=RED]([/color][/b][b][color=BLUE]/[/color][/b] xr cod itm reply[b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] xr [b][color=RED]([/color][/b][b][color=BLUE]dictsearch[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]namedobjdict[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"AcadDim"[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]progn[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]foreach[/color][/b] cod [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=#009900]3[/color][/b] [b][color=#009900]40[/color][/b] [b][color=#009900]60[/color][/b] [b][color=#009900]61[/color][/b] [b][color=#009900]62[/color][/b] [b][color=#009900]63[/color][/b] [b][color=#009900]64[/color][/b] [b][color=#009900]65[/color][/b] [b][color=#009900]66[/color][/b] [b][color=#009900]67[/color][/b] [b][color=#009900]68[/color][/b] [b][color=#009900]69[/color][/b] [b][color=#009900]70[/color][/b] [b][color=#009900]71[/color][/b] [b][color=#009900]72[/color][/b] [b][color=#009900]170[/color][/b] [b][color=#009900]340[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] itm [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] cod xr[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] reply [b][color=RED]([/color][/b][b][color=BLUE]append[/color][/b] reply [b][color=RED]([/color][/b][b][color=BLUE]list[/color][/b] itm[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] reply[b][color=RED])[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]3[/color][/b] . [b][color=#ff00ff]""[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]40[/color][/b] . [b][color=#009999]0.0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]60[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]61[/color][/b] . [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]62[/color][/b] . [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]63[/color][/b] . [b][color=#009900]3[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]64[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]65[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]66[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]67[/color][/b] . [b][color=#009900]3[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]68[/color][/b] . [b][color=#009900]1[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]69[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]70[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]71[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]72[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]170[/color][/b] . [b][color=#009900]0[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]defun[/color][/b] acet-ql-set [b][color=RED]([/color][/b]arg [b][color=BLUE]/[/color][/b] cur prm[b][color=RED])[/color][/b] [i][color=#990099];; fetch current[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] cur [b][color=RED]([/color][/b]acet-ql-get[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; override per argument[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]while[/color][/b] arg [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] prm [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] arg[b][color=RED])[/color][/b] arg [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] arg[b][color=RED])[/color][/b] cur [b][color=RED]([/color][/b][b][color=BLUE]subst[/color][/b] prm [b][color=RED]([/color][/b][b][color=BLUE]assoc[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] prm[b][color=RED])[/color][/b] cur[b][color=RED])[/color][/b] cur[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; handle DIMLDRBLK[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]if[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]=[/color][/b] [b][color=#009900]3[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]car[/color][/b] prm[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setvar[/color][/b] [b][color=#ff00ff]"DIMLDRBLK"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]cdr[/color][/b] prm[b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; put back[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]dictremove[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]namedobjdict[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"AcadDim"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]setq[/color][/b] cur [b][color=RED]([/color][/b][b][color=BLUE]append[/color][/b] [b][color=DARKRED]'[/color][/b][b][color=RED]([/color][/b][b][color=RED]([/color][/b][b][color=#009900]0[/color][/b] . [b][color=#ff00ff]"XRECORD"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]100[/color][/b] . [b][color=#ff00ff]"AcDbXrecord"[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=#009900]90[/color][/b] . [b][color=#009900]990106[/color][/b][b][color=RED])[/color][/b][b][color=RED])[/color][/b] cur[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]dictadd[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]namedobjdict[/color][/b][b][color=RED])[/color][/b] [b][color=#ff00ff]"AcadDim"[/color][/b] [b][color=RED]([/color][/b][b][color=BLUE]entmakex[/color][/b] cur[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [b][color=RED]([/color][/b]acet-ql-get[b][color=RED])[/color][/b][b][color=RED])[/color][/b] [i][color=#990099];; load quietly[/color][/i] [b][color=RED]([/color][/b][b][color=BLUE]princ[/color][/b][b][color=RED])[/color][/b]
  14. Lee Mac

    Polyline to circle

    Haha, you can do that anyway: EXOFFSET (Express tools). Anyway going back to your leader issue, I found this online: ;;; qlset.lsp - example initialization of QLEADER settings ;;; Frank Whaley, Autodesk ;;; ;;; Two functions are included in this file: ;;; ;;; (acet-ql-Set) ;;; 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 ;;; ;;; |; acad-push-dbmod (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) (defun c:ql () (acet-ql-set '((3 . "Open30") (40 . 0.0) (60 . 4) (61 . 0) (62 . 1) (63 . 3) (64 . 0) (65 . 0) (66 . 0) (67 . 3) (68 . 0) (69 . 0) (70 . 0) (71 . 0) (72 . 0) (170 . 0))) (princ)) Credit where credit's due - I could never have thought to do this! Type "ql" for leader.
×
×
  • Create New...