Author Topic: (setq d2 (assoc 40 d1)) help sought  (Read 3648 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: (setq d2 (assoc 40 d1)) help sought
« Reply #15 on: January 27, 2011, 09:34:37 AM »
OK I couldn't resist. 8-)
Code: [Select]
(princ "\nEnter:pdstxt")


(defun c:pdstxt (/ txt1)

  (defun LayerMake(lyrname Color ltype)
    (if (tblsearch "LAYER" lyrname)
      (command "._Layer" "_Thaw" lyrname "_On" lyrname "_UnLock" lyrname "_Set" lyrname "")
      (command "._Layer" "_Make" lyrname "_Color"
               (if (or (null color)(= Color "")) "_White" Color) lyrname
               "LT" (if (or (null ltype)(= ltype "")) "Continuous" ltype) lyrname "")
    )
  )


 
  ;; change the rogue heights to the rounded off standard height 
  (defun CTX ( data / ss n index lName)
    (setq size (car data)
          fuzz (cadr data)
          color (caddr data)
    )
    (if (setq ss (ssget "x"
                        (list '(0 . "text,mtext")
                              '(-4 . ">")
                              (cons 40 (- size fuzz))
                              '(-4 . "<")
                              (cons 40 (+ size fuzz))
                        )
                 )
        )
      (progn
       (setq i -1)
       (while (setq ename (ssname ss (setq i (1+ i))))
          (setq elist (entget ename))
          (entmod (subst (cons 40 size) (assoc 40 eList) eList))
        )
       (setq lName (itoa size))
       (while (< (strlen lName) 3)(setq lName (strcat "0" lName)))
       (setq lName (strcat lName"_text"))
       (LayerMake lName color nil)
       (command "change" ss "" "properties" "layer" lName "")
      )
    )
    lName ; return the new name
  )
   
                                        ;all text height

  (if (setq txt1 (ssget "x" '((0 . "text,mtext"))))
    (progn
      (command "-layer" "m" "TEXT" "COLOR" "white" "" "")
      (command "change" txt1 "" "properties" "layer" "text" "")
    )
  )


  (foreach itm
           '(
             (10 1 "white")
             (20 2 "white")
             (25 2 "white")
             (50 5 "white")
             (75 5 "white")
             (100 5 "white")
             (150 5 "white")
             ;(187 4.5 "red")
             (200 5 "green")
             (250 5 "green")
             (300 5 "green")
             (350 5 "green")
             (400 5 "green")
             )
      (ctx itm)
  )

)
(princ)
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.