Author Topic: Another Hectic Question / Idea  (Read 6024 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« on: June 22, 2004, 08:47:21 PM »
I know I have been asking alot today... and I apologise. You guys know your stuff! and you are really impressive! I have been slowly learning from the codes that you have shown and created! again, you guys do a wonderful job.

As for another crazy 007 question here we go!
this does tie into other things i have mentioned.

ties with linework Labeling...

I have layers with lines on them
EX_1
EX_2
EX_3

I want to select EX_1 line at a spot and it starts a leader line and then Labels the Line, the Layer Name.

now here is the twist,

If I select EX_1 line and starts my leader with label,

Is there a way that EX_1 could be translated to Existing 1. in the code.


----
So if the line selected is EX_1, then the Label (text) would be Existing 1.
----

Ex. A
........................__ Existing 1
....................../
..................../
Line (EX_1)  V


Ex. B

Existing 1 __
...................\
.....................\
..................... V Line (EX_1)



Thanks Guys!!!!!!!!!!!!!!!!!
Civil3D 2020

ELOQUINTET

  • Guest
Another Hectic Question / Idea
« Reply #1 on: June 24, 2004, 11:44:31 AM »
nice psuedocode  :P

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #2 on: June 24, 2004, 11:48:48 AM »
lol you like that ! :)
Civil3D 2020

Trev

  • Guest
Another Hectic Question / Idea
« Reply #3 on: June 25, 2004, 06:50:07 AM »
Here is a crude one. Doesn't setup any layers for the label etc.

Code: [Select]

(defun DTR(A)(* PI(/ A 180.0)))
(defun RTD(A)(/(* 180 A)PI))
(defun c:Label(/ lay_name lab_val)
(setvar "cmdecho" 0)
(setq OM(getvar "orthomode"))
(setvar "orthomode" 0)
(setvar "osmode" 512)
(setq P1(getpoint "\nPick start of leader:"))
(setvar "osmode" 128)
(setq CWP1(polar P1(dtr 45)1)
CWP2(polar P1(dtr 225)1)
SSG1(ssget "c" CWP1 CWP2)
IND 0 SEL 5)
(setvar "osmode" 0)
(while SEL
(setq NME1(ssname SSG1 IND)
ENT_DATA(entget NME1)
)
(setq LAY_NAME(cdr(assoc 8 ENT_DATA)))
(setq SEL nil)
(cond
((= LAY_NAME "EX_1")(setq LAB_VAL "Existing 1."))
((= LAY_NAME "EX_2")(setq LAB_VAL "Existing 2."))
((= LAY_NAME "EX_3")(setq LAB_VAL "Existing 3."))
((= LAY_NAME "EX_4")(setq LAB_VAL "Existing 4."))
((= LAY_NAME "EX_5")(setq LAB_VAL "Existing 5."))
(t nil)
)
)

(if(/= LAB_VAL nil)
(progn
(setq P2(getpoint p1 "\n  To point: "))
(setvar "orthomode" 1)
(command "leader" P1 P2 "a" LAB_VAL "")
(setvar "orthomode" OM)
)
(alert "Entity Selected is not on an EX_? layer")
)
(prin1)
)

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #4 on: June 25, 2004, 08:12:39 AM »
You know me... quick question

"      (cond
         ((= LAY_NAME "EX_1")(setq LAB_VAL "Existing 1."))
         ((= LAY_NAME "EX_2")(setq LAB_VAL "Existing 2."))
         ((= LAY_NAME "EX_3")(setq LAB_VAL "Existing 3."))
         ((= LAY_NAME "EX_4")(setq LAB_VAL "Existing 4."))
         ((= LAY_NAME "EX_5")(setq LAB_VAL "Existing 5."))
         (t nil)"

Is there a way to actually ttype in the lisp what layer name to put the information on if possible.

         ((= LAY_NAME "EX_5")(setq LAB_VAL "Existing 5."))  place on This entity on (LAY_NAME "EX_5_TEXT")????

something like this.

and can the leader be placed in the middle of the text rather than under with the tail under the text.

thanks you ROCK
Civil3D 2020

SMadsen

  • Guest
Another Hectic Question / Idea
« Reply #5 on: June 25, 2004, 08:43:38 AM »
My favorite way of dealing with look-up values are association lists. You can put anything into a sublist and look it up based on the value of the first item.

Here's a minor modification of Trev's routine that looks up LAY_NAME in a list of values and, if successfull, extracts text label and text layer:

Code: [Select]
;; LAYERTRANSVALUES returns an assoc list in
;; the format: (object_layer label text_layer)
(defun layerTransValues ()
  '(("EX_1" "Existing 1." "EX_1_TXT")
    ("EX_2" "Existing 2." "EX_2_TXT")
    ("EX_3" "Existing 3." "EX_3_TXT")
    ("EX_4" "Existing 4." "EX_4_TXT")
    ("EX_5" "Existing 5." "EX_5_TXT")
    ;; add to list when needed
   )
)

(defun DTR (A) (* PI (/ A 180.0)))
(defun RTD (A) (/ (* 180 A) PI))

;; changes commented
(defun c:Label (/ lay_name lab_val LAB_LST LAB_REC LAB_LAY CLAY)
  (setvar "cmdecho" 0)
  (setq OM (getvar "orthomode"))
  (setvar "orthomode" 0)
  (setvar "osmode" 512)
  (setq P1 (getpoint "\nPick start of leader:"))
  (setvar "osmode" 128)
  (setq CWP1 (polar P1 (dtr 45) 1)
        CWP2 (polar P1 (dtr 225) 1)
        SSG1 (ssget "c" CWP1 CWP2)
        IND  0
        SEL  5
  )

  ;; get the list of values
  (setq LAB_LST (layerTransValues))

  (setvar "osmode" 0)
  (while SEL
    (setq NME1     (ssname SSG1 IND)
          ENT_DATA (entget NME1)
    )
    (setq LAY_NAME (cdr (assoc 8 ENT_DATA)))
    (setq SEL nil)
    (cond ((setq LAB_REC (assoc LAY_NAME LAB_LST))
           ;; if layer name is associated with a record in LAB_LST
           ;; then set LAB_VAL to 2nd item in record (clear text)
           ;; and layer name to 3rd item in record
           (setq LAB_VAL (cadr LAB_REC)
                 LAB_LAY (caddr LAB_REC)
           )
          )
    )
  )

  (cond ((and LAB_VAL (setq P2 (getpoint p1 "\n  To point: ")))
         ;; save current layer and make/set LAB_LAY
         (setq CLAY (getvar "CLAYER"))
         (command "LAYER" "Make" LAB_LAY "")
         (setvar "orthomode" 1)
         (command "leader" P1 P2 "a" LAB_VAL "")
         (setvar "orthomode" OM)
         ;; restore previous layer
         (setvar "CLAYER" CLAY)
        )
        (alert "Entity Selected is not on an EX_? layer")
  )
  (prin1)
)

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #6 on: June 25, 2004, 10:30:27 AM »
Hey is there a way to get the leader line tail to come to the middle of the text entity.

or is it a toggle in side the lisp somewhere lol

Im searching  ... lol
Civil3D 2020

SMadsen

  • Guest
Another Hectic Question / Idea
« Reply #7 on: June 25, 2004, 10:44:39 AM »
To the middle of the text entity? Do you really mean it should obscure some of the text?

Text justication: Middle center
Vertical position of leader: Centered

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #8 on: June 25, 2004, 10:51:15 AM »
how about Left Center or Right Center depending on which side the leader goes on....
Civil3D 2020

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #9 on: June 25, 2004, 12:16:39 PM »
Hate saying this... Can the Leader in this lisp be changed to a quick leader if needed....



THANKS for the help!!!!!!!!!!
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Hectic Question / Idea
« Reply #10 on: June 25, 2004, 05:40:58 PM »
Try this one out.

Code: [Select]
(defun c:label_prop (/        usercmd  useros   userormode  entl    ent
                     lname    pt       pt2   pt3   offset   ofsdir   txtjust
                     dwg_ht   laytag   lname
                    )
  ;; LAYERTRANSVALUES returns an assoc list in
  ;; the format: (object_layer label text_layer)
  (defun layertransvalues ()
    ;;  Tag  Replacement
    '
     (("EX_" "Existing")
      ("EX-" "Existing")
      ;; add to list when needed
      ;;  Tag MUST be in upper case
     )
  )
  ;;  ================================
  (setq usercmd (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
  (setq useros (getvar "osmode"))
  (setvar "osmode" 0)
  (setq userormode (getvar "osmode"))
  (setvar "orthomode" 0)
  (if (setq ent (entsel "\Select an entity to label."))
    (progn
      (setq pt     (cadr ent)
            lname  (cdr (assoc 8 (entget (car ent)))) ;LAYER NAME
            offset 2 ; amount of box offset from text
      )
      ;;  Layer name check  =============
      (foreach laytag (layertransvalues)
        (if (and (= (strcase (substr lname 1 (strlen (car laytag))))
                    (car laytag)
                 )
                 (> (strlen lname) (strlen (car laytag)))
            )
          (setq lname (strcat (cadr laytag)
                              " "
                              (substr lname (1+ (strlen (car laytag))))
                      )
          )
        )
      )

      (setq cur_qleader (acet-ql-get)) ; Save current settings
      ;Set qleader default to framed text
      (acet-ql-set '((3 . "") (40 . 0.0) (60 . 0) (61 . 1)
                     (62 . 1) (63 . 1)   (64 . 0) (65 . 0)
                     (66 . 0) (67 . 3)   (68 . 0) (69 . 0)
                     (70 . 0) (71 . 1)   (72 . 1) (170 . 0) )
      )
      (if (setq pt2 (getpoint pt "\nPick Next Point..: "))
        (progn
          (command "._line" pt pt2 "")
          (setq entl (entlast))
          (setvar "ORTHOMODE" 1)
          (if (setq pt3 (getpoint pt2 "\nPick End Point..: "))
            (command "._qleader" pt pt2 pt3 lname "")
            (command "._qleader" pt pt2 "" lname "")
          ) ;end if
          (entdel entl)
        )
      )
      (acet-ql-set cur_qleader); restore qleader defaults
    )
  )
  (setvar "CMDECHO" usercmd)
  (setvar "osmode" useros)
  (setvar "orthomode" userormode)

  (princ)
)
;;----------------------------------------------------------------------
;;             Qleader settings
;;----------------------------------------------------------------------
;;  See Frank Whaley's code for more options
(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)
  (setq cur (acet-ql-get));  fetch current
  ;;  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)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #11 on: June 25, 2004, 08:39:48 PM »
check PM cab! thanks!
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Hectic Question / Idea
« Reply #12 on: June 25, 2004, 11:00:25 PM »
Here is the Qleader version:

Code: [Select]

;; changes commented
(defun c:label (/ lay_name lab_val lab_lst lab_rec lab_lay clay)
(defun dtr (a) (* pi (/ a 180.0)))
(defun rtd (a) (/ (* 180 a) pi))
(defun layertransvalues ()
  ;; layer   leader text   text layer
  '(("EX_1" "Existing 1." "EX_1_TXT")
    ("EX_2" "Existing 2." "EX_2_TXT")
    ("EX_3" "Existing 3." "EX_3_TXT")
    ("EX_4" "Existing 4." "EX_4_TXT")
    ("EX_5" "Existing 5." "EX_5_TXT")
    ;; add to list when needed
   )
)
 
  (setvar "cmdecho" 0)
  (setq om (getvar "orthomode"))
  (setvar "orthomode" 0)
  (setvar "osmode" 512)
  (setq p1 (getpoint "\nPick start of leader:"))
  (setvar "osmode" 128)
  (setq ssg1 (ssget "c" (polar p1 (dtr 45) 1) (polar p1 (dtr 225) 1))
        ind  (sslength ssg1)
  )

  ;; get the list of values
  (setq lab_lst (layertransvalues))
  (setvar "osmode" 0)
  (while (>=(setq ind (1- ind))0)
    (setq nme1     (ssname ssg1 ind)
          ent_data (entget nme1)
    )
    (setq lay_name (cdr (assoc 8 ent_data)))
    (cond ((setq lab_rec (assoc lay_name lab_lst))
           ;; if layer name is associated with a record in LAB_LST
           ;; then set LAB_VAL to 2nd item in record (clear text)
           ;; and layer name to 3rd item in record
           (setq lab_val (cadr lab_rec)
                 lab_lay (caddr lab_rec)
                 ind     0 ; exit loop
           )
          ); end cond 1
    ); end cond stmt
  )

  (cond ((and lab_val (setq p2 (getpoint p1 "\n To point: ")))
         ;; save current layer and make/set LAB_LAY
         (setq clay (getvar "CLAYER"))
         (command "LAYER" "Make" lab_lay "")
         (setvar "orthomode" 1)
         (setq cur_qleader (acet-ql-get)) ; Save current settings
         ;Set qleader default to framed text
         (acet-ql-set '((3 . "") (40 . 0.0) (60 . 0) (61 . 1)
                        (62 . 1) (63 . 1)   (64 . 0) (65 . 0)
                        (66 . 0) (67 . 3)   (68 . 0) (69 . 0)
                        (70 . 0) (71 . 1)
                        (72 . 0) ; (72 . 1) ; frame text
                        (170 . 0) )
         )
         (command "._qleader" p1 p2 "" lab_val "")
         (acet-ql-set cur_qleader); restore qleader defaults
         (setvar "orthomode" om)
         ;; restore previous layer
         (setvar "CLAYER" clay)
        )
        ((alert "Entity Selected is not in layer list."))
  )
  (prin1)
)

;;----------------------------------------------------------------------
;;             Qleader settings
;;----------------------------------------------------------------------
;;  See Frank Whaley's code for more options
(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)
  (setq cur (acet-ql-get));  fetch current
  ;;  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)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #13 on: June 25, 2004, 11:11:25 PM »
CAB,

Here is what is going on. I have attached the zip with the layers and what it did for me with the lisp routine

http://theswamp.org/lilly.pond/mstg007/cab%20label.zip

I opened the drawing and insert the lisp
 I keep getting Existing Curb to label on everythin entity i select... You will see that in the drawing. The leader goes to the correct layer but the text does not. BUT the label looks like it should:) you dah man on that one! I hope that helps! kinda hard doing this blind and out of the blue!

thank you once again
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Hectic Question / Idea
« Reply #14 on: June 27, 2004, 02:18:40 PM »
Try this one:

Code: [Select]
(defun c:label (/ lay_name lab_val lab_lst lab_rec lab_lay clay)
(defun dtr (a) (* pi (/ a 180.0)))
(defun rtd (a) (/ (* 180 a) pi))
(defun layertransvalues ()
  ;; layer   leader text   text layer
  '(("BPL" "EXISTING PROPERTY LINE" "BPL-TXT")
    ("BPL-PROPOSED-RW" "PROPOSED RIGHT-OF-WAY" "BPL-RW-TXT")
    ("BPL-RW" "EXISTING RIGHT-OF-WAY" "BPL-RW-TXT")
    ("BPL-SECLINE" "EXISTING SECTION LINE" "BPL-SECLINE-TXT")
    ("EX-BLDG" "EXISTING BUILDING" "EX-BLDGTX")
    ("EX-BUSH" "EXISTING BUSH" "EX-TEXT")
    ("EX-CANOPY" "EXISTING CANOPY" "EX-TEXT")
    ("EX-CONC-WALK" "EXISTING CONCRETE WALK" "EX-TEXT")
    ("EX-CONCRETE" "EXISTING CONCRETE" "EX-TEXT")
    ("EX-CONCRETE-TRENCH" "EXISTING CONCRETE TRENCH" "EX-TEXT")
    ("EX-CURB" "EXISTING CURB" "EX-TEXT")
    ("EX-EOW" "EXISTING EDGE OF WATER" "EX-TEXT")
    ("EX-FENCE" "EXISTING FENCE LINE" "EX-TEXT")
    ("EX-GRAVEL" "EXISTING GRAVEL" "EX-TEXT")
    ("EX-ISLAND" "EXISTING ISLAND" "EX-TEXT")
    ("EX-LANDSCAPE" "EXISTING LANDSCAPE" "EX-TEXT")
    ("EX-PAVEMENT" "EXISTING PAVEMENT" "EX-TEXT")
    ("EX-POLE" "EXISTING POLE" "EX-TEXT")
    ("EX-PSTRIPE" "EXISTING PAINT STRIPE" "EX-TEXT")
    ("EX-RETWALL" "EXISTING RETAINING WALL" "EX-TEXT")
    ("EX-ROAD-CL" "EXISTING ROAD CENTERLINE" "EX-TEXT")
    ("EX-SIGNS" "EXISTING SIGN" "EX-TEXT")
    ("EX-SWALE" "EXISTING SWALE" "EX-TEXT")
    ("EX-TB" "EXISTING TOP OF BANK" "EX-TEXT")
    ("EX-TREES" "EXISTING TREES" "EX-TEXT")
    ("EX-TS" "EXISTING TOE OF SLOPE" "EX-TEXT")
    ("EXUT-CABLE" "EXISTING CABLE LINE " "EX-TEXT")
    ("EXUT-ELEC" "EXISTING ELECTRIC LINE" "EX-TEXT")
    ("EXUT-FO" "EXISTING FIBER OPTIC LINE" "EX-TEXT")
    ("EXUT-GAS" "EXISTING GAS LINE" "EX-TEXT")
    ("EXUT-H2O" "EXISTING WATER LINE" "EX-TEXT")
    ("EXUT-IR" "EXISTING IRRIGATION" "EX-TEXT")
    ("EXUT-LIGHTS" "EXISTING LIGHT" "EX-TEXT")
    ("EXUT-MWELL" "EXISTING MONITORING WELL" "EX-TEXT")
    ("EXUT-OVERHEAD" "EXISTING OVERHEAD UTILITY" "EX-TEXT")
    ("EXUT-POLE" "EXISTING UTILITY POLE" "EX-TEXT")
    ("EXUT-SANITARY" "EXISTING SANITARY LINE" "EXUT-SANITARY-TXT")
    ("EXUT-SANITARY-MH" "EXISTING SANITARY MANHOLE" "EXUT-SANITARY-TXT")
    ("EXUT-STORM" "EXISTING STORM LINE" "EXUT-STORM-TXT")
    ("EXUT-STORM-MH" "EXISTING STORM MANHOLE" "EXUT-STORM-TXT")
    ("EXUT-TELEPHONE" "EXISTING TELEPHONE LINE" "EX-TEXT")
    ("EXUT-TRAFFIC" "EXISTING TRAFFIC UTILITY" "EX-TEXT")  
    ;; add to list when needed
   )
)
 
  (setvar "cmdecho" 0)
  (setq om (getvar "orthomode"))
  (setvar "orthomode" 0)
  (setvar "osmode" 512)
  (setq p1 (getpoint "\nPick start of leader:"))
  (setvar "osmode" 128)
  (if (setq ssg1 (ssget p1))
    (progn
      (setq ind (sslength ssg1))
      ;; get the list of values
      (setq lab_lst (layertransvalues))
      (setvar "osmode" 0)
      (while (>=(setq ind (1- ind))0)
        (setq nme1     (ssname ssg1 ind)
              ent_data (entget nme1)
        )
        (setq lay_name (cdr (assoc 8 ent_data)))
        (cond
          ((setq lab_rec (assoc lay_name lab_lst))
            ;; if layer name is associated with a record in LAB_LST
            ;; then set LAB_VAL to 2nd item in record (clear text)
            ;; and layer name to 3rd item in record
            (setq lab_val (cadr lab_rec)
                  lab_lay (caddr lab_rec)
                  ind     0 ; exit loop
            )
          ); end cond 1
        ); end cond stmt
      ) ; while
     
      (cond
        ((and lab_val (setq p2 (getpoint p1 "\n To point: ")))  
           ;; save current layer and make/set LAB_LAY
           (setq clay (getvar "CLAYER"))
           (command "LAYER" "Make" lab_lay "")
           (setvar "orthomode" 1)
           (setq cur_qleader (acet-ql-get)) ; Save current settings
           ;Set qleader default to framed text
           (acet-ql-set '((3 . "") (40 . 0.0) (60 . 0) (61 . 0)
                          (62 . 1) (63 . 1)   (64 . 0) (65 . 0)
                          (66 . 0) (67 . 3)   (68 . 0) (69 . 0)
                          (70 . 0) (71 . 1)
                          (72 . 0) ; (72 . 1) ; frame text
                          (170 . 0) )
           )
           (command "._qleader" p1 p2 "" lab_val "")
           (acet-ql-set cur_qleader); restore qleader defaults
           (setvar "orthomode" om)
           ;; restore previous layer
           (setvar "CLAYER" clay)
        )
        ((alert "Entity Selected is not in layer list."))
      ) ; end cond stmt
 ); progn
 (prompt "\n***--  Missed object.  --***")
); endif
  (prin1)
)

;;----------------------------------------------------------------------
;;             Qleader settings
;;----------------------------------------------------------------------
;;  See Frank Whaley's code for more options
(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 . 0)
      (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)
  (setq cur (acet-ql-get));  fetch current
  ;;  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 initialization of QLEADER settings
;;  Frank Whaley    Autodesk, Inc.
;;  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
;;
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #15 on: June 27, 2004, 02:28:03 PM »
You are the CAPTIN til the end!!!!!!!

You dah man!

WOWOWOWOWOWOOWOWOWOWOOWOW.

and i have to say this one more time...

THANKYOU!!!!!!
Civil3D 2020

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Another Hectic Question / Idea
« Reply #16 on: June 27, 2004, 02:48:06 PM »
Glad we could help,
I just follow Stig around borrowing his code..
And thanks to Trev who got us started.

CAB
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

MSTG007

  • Gator
  • Posts: 2603
  • I can't remeber what I already asked! I need help!
Another Hectic Question / Idea
« Reply #17 on: June 27, 2004, 08:21:45 PM »
Yup Yup Yup thank you all
Civil3D 2020