
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a slate of pre-defined colors that I use to programmatically control layers.
I am writing a routine to draw a chart showing the color number, a solid showing the specified color as a square, and below that the name of the variable that contains the color. My problem is that when I call (drawmark), it will not even run. It reports "Too few arguments". Does anyone else get this error? What is causing it?
;define the color variables
(setq CLR-RED1 241 CLR-RED2 230 CLR-RED3 1 CLR-RED4 242 CLR-RED5 244)
;get the start point and calculate all required points (easier to debug)
(defun MARKPOINTS (/ PT P1 P2 P3 P4 BDRPTS& CNUMTXPT CLRSQPTS& CNAMTXPT C)
(setq PT (getpoint "\nPick upper left point"))
(setq P1 PT P2 (polar P1 0 20) P3 (polar P2 (* PI 1.5) 30) P4 (polar P1 (* PI 1.5) 30))
(setq BDRPTS& (list P1 P2 P3 P4))
(setq C (polar PT 0 10))
(setq C (polar C (* PI 1.5) 8))
(setq CNUMTXPT C)
(setq C (polar C (* PI 1.5) 2))
(setq P1 (polar C PI 5) P2 (polar C 0 5) P3 (polar P2 (* PI 1.5) 10) P4 (polar P1 (* PI 1.5) 10))
(setq CLRSQPTS& (list P1 P2 P4 P3))
(setq C (polar C (* PI 1.5) 18))
(setq CNAMTXPT C)
(list BDRPTS& CNUMTXPT CLRSQPTS& CNAMTXPT)
)
;draw the mark and label it
(defun DRAWMARK (\ PTS& OSM CLR)
(setq PTS& (markpoints))
(command "_.PLINE") (foreach F_PT (car PTS&)(command F_PT)) (command "c")
(command "_.TEXT" "J" "C" (cadr PTS&) "6" "0" CLR "")
(command "_.SOLID") (foreach F_PT (caddr PTS&)(command F_PT)) (command "")
(setq CLR (itoa (eval (read VARNAM))))
(command "_.CHPROP" "L" "" "C" CLR "")
(command "_.TEXT" "J" "C" (cadddr PTS&) "6" "0" (substr VARNAM 5) "")
(prin1)
)
(setq VARNAM "CLR-RED1") ;set a global variable with the name of the variable
(drawmark) ;call the routine
Solved! Go to Solution.