antoniusxylem Posted June 15, 2015 Posted June 15, 2015 I've tried several different ways to insert a block at a specific z point and have the hardest time doing so. I would like the x & Y to be where the getpoint is but the z to be at an elevation of 2332.5 or 194'-4.5" Any help welcome... (defun C:*5 ( / ol ev ln pt1 pt2 x y z ) (setq ol(getvar "clayer")) (setq ev (getvar "elevation")) (command "layer" "s" "ALO" "") (command "elevation" "2332.5") (setq pt1 (getpoint "\nChoose a point : ")) (setq x (car pt1)) (setq y (cadr pt1)) (setq z (2332.5)) (setq pt2 (list x y z)) (command "_.-insert" "d:/CAD_BLOCKS/ALO.dwg" "_non" pt2 "" "" "") (setvar "clayer" ol) ;;;(setvar "elevation" ev) (princ) ) then I tried (defun C:*5 ( / ol uc ln pt1 pt2 x y z ) (setq ol(getvar "clayer")) (setq uc (getvar "ucs")) (command "layer" "s" "ALO" "") (command "UCS" "W" "UCS" "NEW" "0,0,194'-4.5") (setq pt1 (getpoint "\nChoose a point : ")) (setq x (car pt1)) (setq y (cadr pt1)) (setq z (caddr 0)) (setq pt2 (list x y z)) (command "_.-insert" "d:/CAD_BLOCKS/ALO.dwg" "_non" pt2 "" "" "") (setvar "clayer" ol) ;;;(setvar "ucs" uc) (princ) ) Thanks in advance Quote
Tharwat Posted June 15, 2015 Posted June 15, 2015 I would like the x & Y to be where the getpoint is but the z to be at an elevation of 2332.5 or 194'-4.5" Just an example. (setq p (getpoint "\nSpecify point :")) (setq xyz (list (car p) (cadr p) 2332.5)) Quote
tombu Posted June 15, 2015 Posted June 15, 2015 No lisp needed just use the insert command, use the point filter .z then enter 2332.5 then pick point for the x and y. From Help: To Use Coordinate Filters to Specify a Point in 3D http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-254BC000-91C5-40C5-BDF2-883F0D8B7700 Quote
antoniusxylem Posted June 15, 2015 Author Posted June 15, 2015 No lisp needed just use the insert command, use the point filter .z then enter 2332.5 then pick point for the x and y.From Help: To Use Coordinate Filters to Specify a Point in 3D http://help.autodesk.com/view/ACD/2016/ENU/?guid=GUID-254BC000-91C5-40C5-BDF2-883F0D8B7700 You cant manually add a .z insertion elevation I've tried several different ways. You can add a z axis if the dialog box comes up. Thank you. Quote
antoniusxylem Posted June 15, 2015 Author Posted June 15, 2015 Just an example. (setq p (getpoint "\nSpecify point :")) (setq xyz (list (car p) (cadr p) 2332.5)) this adds 2332.5" to the getpoint. It do not insert the object at that elevation... I'll try to modify this, I think its close but no cigar. Thank you Quote
tombu Posted June 15, 2015 Posted June 15, 2015 Sorry use .xy pick point and you get the prompt: Specify first point: .XY of _endp of (need Z): Then enter 2332.5 Point Filters are also available from the Object Snap Cursor Menu Been around longer than the 22 years I've been using AutoCAD Lots of help including videos online search for "AutoCAD point filters" or just check AutoCAD help. Quote
antoniusxylem Posted June 15, 2015 Author Posted June 15, 2015 Sorry use .xy pick point and you get the prompt: Specify first point: .XY of _endp of (need Z): Then enter 2332.5 Point Filters are also available from the Object Snap Cursor Menu Been around longer than the 22 years I've been using AutoCAD Lots of help including videos online search for "AutoCAD point filters" or just check AutoCAD help. Yes this worked, I too have been using acad since 1993, I have just recently started getting in depth with 3 dimensional space. I write many routines but the most complicated routine lacks z axis. LOL. this worked I'll add it in a lisp and thanks again. Quote
BIGAL Posted June 16, 2015 Posted June 16, 2015 Maybe (command "move" "L" "" (list 0.0 0.0 0.0) (list 0.0 0.0 2333.5)) Quote
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.