Jump to content

Recommended Posts

Posted

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

Posted
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))

Posted
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.

Posted
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

Posted

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.

Posted
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.

Posted

Maybe

 

(command "move" "L" "" (list 0.0 0.0 0.0) (list 0.0 0.0 2333.5))

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...