mitre962 Posted February 15, 2017 Share Posted February 15, 2017 Please help! New to writing LISP's, never used cond before. I'm trying to create a LISP which inserts a block whom's insertion point is determined using a cond statement which evaulates the dwgname variable and returns a value for the insertion coordinates depending on what the dwgname is. If neither are true, it asks for the insertion point to be picked. Please note that stamp.dwg is in my support path so should be able to be located by AutoCAD. Here is what I have... (defun c:insertstamp (x y filename) (setq filename (getvar dwgname)) (stamp:getcoord) (defun stamp:getcoord () (cond ( (= filename A1L.dwg) ((setq x (778.5)) (setq y (204.6716)) (stamp:insert) ) ( (= filename A1P.dwg) ((setq x (531.5)) (setq y (204.6716)) (stamp:insert) ) (t (setq ins (getpoint "Pick Point to Label: ")) (stamp:insert1) ) ) ) (defun stamp:insert () (command _insert stamp.dwg (x,y)) ) (defun stamp:insert1 () (command _insert stamp.dwg ins) ) ) THANKYOU! Quote Link to comment Share on other sites More sharing options...
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.