Jump to content

Recommended Posts

Posted

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

Posted

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.

Posted

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.

Posted

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

Posted

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

Posted

You can also quickly get the information with the SYSVDLG command...

 

cecolor.png

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...