antoniusxylem Posted May 19, 2015 Share Posted May 19, 2015 So I want to insert a block that is below the initial insertion point without changing the block. I've been busting my brain trying to get this lisp routine to work correctly. I think I'm close I get a malformed error on input. Can anybody help me out? (defun C:*789 (/ oldlayer pt1 pt2) (setq pt1 (getpoint "\nChoose a point : ")) (setq x (/ (car pt1) (setq y (/ (cadr pt1) (setq z (/ (caddr pt1) - 0.353)) (setq pt2 (x y z)) (command "insert" "C:/CAD_BLOCKS/J-Hangers/J-HANGER-050.dwg" pt2 "" "" ) (PROMPT " \ Rotation Point") (princ) ) ) Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 19, 2015 Share Posted May 19, 2015 Welcome to CADTutor Here are some quick corrections to your code: (defun C:789 ( / pt1 pt2 x y z ) (setq pt1 (getpoint "\nChoose a point : ")) (setq x (car pt1)) (setq y (cadr pt1)) (setq z (- (caddr pt1) 0.353)) (setq pt2 (list x y z)) (command "_.-insert" "C:/CAD_BLOCKS/J-Hangers/J-HANGER-050.dwg" "_non" pt2 "" "" "\\") (princ) ) For an explanation of the error, please refer to my Error Message Troubleshooter. PS: Please edit your post and enclose your code with code tags: [highlight][noparse] [/noparse][/highlight] Your code here [highlight][noparse] [/noparse][/highlight] Quote Link to comment Share on other sites More sharing options...
antoniusxylem Posted May 19, 2015 Author Share Posted May 19, 2015 Much appreciated, I understand what I was doing wrong now! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 19, 2015 Share Posted May 19, 2015 You're welcome! 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.