hokie555 Posted October 14, 2009 Share Posted October 14, 2009 Hello everyone, Here's my problem: I'm building a lisp routine that inserts a block along a line and I want the block to be placed on the layer that the line is on +1 (The route I'm taking is just to change the current layer before insertion instead of changing the block attribute. If it's easier for you to do it the other way that's fine. Also, all layers are numerical). For example, if the line is on layer 2, I want the block to be placed automatically on layer 3. Below is my failed attempt. Can anyone help? Thank you. (setq linelayer(assoc 8 ent2)) (setq blocklayer (+ (atoi linelayer) 1) (setq blocklayer (itoa blocklayer)) (setvar "clayer" blocklayer) Quote Link to comment Share on other sites More sharing options...
CarlB Posted October 14, 2009 Share Posted October 14, 2009 left off a 'cdr' (setq linelayer (cdr (assoc 8 ent2))) Quote Link to comment Share on other sites More sharing options...
hokie555 Posted October 14, 2009 Author Share Posted October 14, 2009 Thank you sir for responding. still no luck though. comes back with: error: AutoCAD variable setting rejected: "clayer" (8 . "2") fyi the line is on layer 2 Quote Link to comment Share on other sites More sharing options...
hokie555 Posted October 14, 2009 Author Share Posted October 14, 2009 oops found the other problem. needed another ")" at the end of line 2. Thanks again! Quote Link to comment Share on other sites More sharing options...
CarlB Posted October 14, 2009 Share Posted October 14, 2009 From error it doesn't seem like you fixed the right line. The following should work, if 'ent2' is the line "entget" list. (setq linelayer (cdr (assoc 8 ent2))) (setq blocklayer (+ (atoi linelayer) 1) (setq blocklayer (itoa blocklayer)) (setvar "clayer" blocklayer) -----edit------ oops, OK, glad you got it. Quote Link to comment Share on other sites More sharing options...
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.