KrazyMann225 Posted July 11, 2011 Posted July 11, 2011 I'm trying to make the layer color switch before it draws a line but when I execute the lisp I get the error code: "Program ERROR: AutoCAD variable setting rejected: "CECOLOR" 7" can anyone tell me why I can't us setvar to change this system variable? (defun c:draw (/ COUNTER color ccolor) (setq ccolor (getvar "cecolor")) (setq color (atoi "7")) (setvar "CECOLOR" color) (setq color "10") (command "line" "0,0" "0,10" "" ) ) I have also tried: (defun c:draw (/ COUNTER color ccolor) (setq ccolor (getvar "cecolor")) (setvar "CECOLOR" 7) (setq color "10") (command "line" "0,0" "0,10" "" ) ) help Quote
KrazyMann225 Posted July 11, 2011 Author Posted July 11, 2011 well I guess all the good ideas strike you in the washroom, i figured it out, I needed to covert the value to a string rather then an int. Quote
Lee Mac Posted July 11, 2011 Posted July 11, 2011 Quickest reference for System Variable properties would be to type 'sysvdlg' at the command line and use the wildcard search box. Here's another; An online reference: http://docs.autodesk.com/ACD/2011/ENU/filesACR/WSfacf1429558a55de6d0beb1006696e53b-6076.htm CECOLOR: http://docs.autodesk.com/ACD/2011/ENU/filesACR/WS1a9193826455f5ffa23ce210c4a30acaf-50e1.htm Quote
KrazyMann225 Posted July 11, 2011 Author Posted July 11, 2011 also "F1" works too to get that information, but it doesn't debug the code and inform you that you used an integer where a string is required. and ironicaly enough those help files (the ones you just posted) told me i need an integer value to use the ACI thus i tried to input a integer, but it wanted a string. Quote
Lee Mac Posted July 11, 2011 Posted July 11, 2011 The point is that both of the references I suggested and the AutoCAD Help files list the System Variable data type: [b]CECOLOR[/b] [color=red][b]Type: String[/b][/color] Saved in: Drawing Initial value: BYLAYER Quote
KrazyMann225 Posted July 11, 2011 Author Posted July 11, 2011 HA! i gotta start opening my eyes when I read these help files. LoL, but on that note the help file is contradictory then. Quote
alanjt Posted July 11, 2011 Posted July 11, 2011 You can also quickly get the information with the SYSVDLG command... Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.