0 Members and 1 Guest are viewing this topic.
Here is an error Code - Auto/Visual Lisp: [Select](defun c:test3 (/ b bname p scale) ;scalebar < .. >(princ) [CHECKING TEXT <Untitled-0> loading...]..; error: malformed list on input; Check done.
Kerry is it possible to add a filter and when the scale is 50,150,250,350,450,650,...... then use this math for D2Code: [Select](cons "D2" (strcat (rtos (/ scale 100) 2 1)))
(cons "D2" (strcat (rtos (/ scale 100) 2 1)))
(lm:vl-setattributevalue b "D2" (strcat (rtos (/ scl 100) 2 1)))
(lm:vl-setattributevalue b "D1" (strcat (rtos (/ scl 50) 2 0)));(lm:vl-setattributevalue b "D2" (strcat (rtos (/ scl 100) 2 0)))(if (vl-position scl (list 50 150 250 350 450 650)) (cons "D2" (strcat (rtos (/ scl 100.) 2 1))) (cons "D2" (strcat (rtos (/ scl 100) 2 0)))) (lm:vl-setattributevalue b "D3" (strcat (rtos (/ scl 50) 2 0)))(lm:vl-setattributevalue b "D4" (strcat (rtos (* (/ scl 50) 2) 2 0)))(lm:vl-setattributevalue b "D5" (strcat (rtos (* (/ scl 50) 3) 2 0)))(lm:vl-setattributevalue b "D6" (strcat (rtos (* (/ scl 50) 4) 2 0)))(lm:vl-setattributevalue b "D7" (strcat (rtos (/ scl 10) 2 0)))(lm:vl-setattributevalue b "SCALE" (strcat (rtos scl 2 0)))(setvar 'attreq 1)))(princ)
;;;; Concept code : kdub@theSwamp Nov2014(defun c:test3a (/ b bname p scale TagData ) ;scalebar (if (and (setq scale (getint "\nEnter scale to use: ")) (setq p (getpoint "\nSelect insert point for scale bar:")) (setq bname (findfile "test.dwg")) ) (progn (command "_layer" "_m" "scale" "_c" "7" "" "") (setvar 'attreq 0) (command _"insert" bname p scale scale "0") (setq b (vlax-ename->vla-object (entlast))) (setq TagData (list (cons "D1" (strcat (rtos (/ scale 50) 2 0))) (if (= 50 (rem scale 100)) ;; (vl-position scale (list 50 150 250 350 450 650)) (cons "D2" (strcat (rtos (/ scale 100.) 2 1))) (cons "D2" (strcat (rtos (/ scale 100) 2 0))) ) (cons "D3" (strcat (rtos (/ scale 50) 2 0))) (cons "D4" (strcat (rtos (* (/ scale 50) 2) 2 0))) (cons "D5" (strcat (rtos (* (/ scale 50) 3) 2 0))) (cons "D6" (strcat (rtos (* (/ scale 50) 4) 2 0))) (cons "D7" (strcat (rtos (/ scale 10) 2 0))) (cons "SCALE" (strcat (rtos scale 2 0))) ) ) (kdub:setattributes b TagData) (setvar 'attreq 1) ) ))(princ)
< .. >This code is not filling the tags in my Autocad 2010 !!
Where i can find the kdub:setattributes function ? can you post it ?