Jump to content

KrazyMann225

Recommended Posts

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 :(

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

HA! i gotta start opening my eyes when I read these help files. LoL, but on that note the help file is contradictory then.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...