Ok so I have been working on this simple Autolisp routine for a window I've decided to do in plan view. This is the routine I have so far but there is an eor that keeps occuring during the command portion. Can anyone be a help to helping me figure this out?
(SETQ IP (GetPoint "\n Pick Insertion Point"))
(SETQ WW (GetReal "\n Enter Window Width"))
(SETQ WH (GetReal "\n Enter Window Height"))
(SETQ WP (LIST (+ (CAR IP) WW) (+ (CADR IP) WH)))
(SETQ WS1 (LIST (CAR IP) (+ (CADR IP)(/ WH 3))))
(SETQ WS2 (LIST (+ (CAR WS1) 1) (+ (CADR WS1)(/ WH 3))))
(SETQ WS3 (LIST (+ (CAR WS1) (- WW 1))(CADR WS1)))
(SETQ WS4 (LIST (+ (CAR WS2) (- WW 1))(CADR WS2)))
;(SETQ G1 (LIST (CAR WS2) (- (CADR WS2)(/ WH 10))))
;(SETQ G2 (LIST (+ (CAR G1) (- WW 2))(CADR G1)))
(COMMAND "RECTANGLE" IP WP)
(COMMAND "RECTANGLE" WS1 WS2)
(COMMAND "RECTANGLE" WS3 WS4)
;(COMMAND "LINE" G1 G2)
(prompt "\n done")
(princ)
Solved! Go to Solution.
Solved by tmccar. Go to Solution.
Welcome to these Forums. Some basic suggestions for posting a question in a way that will improve your chances of getting a good answer:
What's the error? Is there any message? Does it just not do something you are expecting it to do, or does it do something you're not expecting?
My first question in a case anything like this: Do you have any running object snap modes on?
Hi - Do you mean that the smaller rectangles are not being constructed? I think it may be related to your "osnap" settings.
The lines I have added should disable the osnap settings while the routine is running, and reset them to their previous values afterwards.
Tom
(SETQ IP (GetPoint "\n Pick Insertion Point"))
(SETQ WW (GetReal "\n Enter Window Width"))
(SETQ WH (GetReal "\n Enter Window Height"))
(SETQ WP (LIST (+ (CAR IP) WW) (+ (CADR IP) WH)))
(SETQ WS1 (LIST (CAR IP) (+ (CADR IP)(/ WH 3))))
(SETQ WS2 (LIST (+ (CAR WS1) 1) (+ (CADR WS1)(/ WH 3))))
(SETQ WS3 (LIST (+ (CAR WS1) (- WW 1))(CADR WS1)))
(SETQ WS4 (LIST (+ (CAR WS2) (- WW 1))(CADR WS2)))
;(SETQ G1 (LIST (CAR WS2) (- (CADR WS2)(/ WH 10))))
;(SETQ G2 (LIST (+ (CAR G1) (- WW 2))(CADR G1)))
(SETQ OSNOW (GETVAR "OSMODE"))
(SETVAR "OSMODE" 0)
(COMMAND "RECTANGLE" IP WP)
(COMMAND "RECTANGLE" WS1 WS2)
(COMMAND "RECTANGLE" WS3 WS4)
;(COMMAND "LINE" G1 G2)
(prompt "\n done")
(SETVAR "OSMODE" OSNOW)
(princ)