Message 1 of 9
Move object using osnaps while retaining original z value
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I've cobbled together the following routine.
(defun c:MXY (/ ss bp)
(defun *error* (MSG)
(if (/= MSG "Function cancelled")
(princ (strcat "\nError: " MSG)))
(if osm (setvar "OSMODE" OSM))
(if lyr (setvar "CLAYER" LYR))
(princ) )
(setq OSM (getvar "OSMODE"))
(setq LYR (getvar "CLAYER"))
(command "OSNAP" "INS,NEA")
(if (and (setq ss (ssget "_:L"))
(setq bp (getpoint "\nSpecify base point: "))
)
(command "_.move" ss "_non" "" bp ".Z" "_non" bp)
)
(setvar "OSMODE" OSM)
(setvar "CLAYER" LYR)
(princ)
)
I was hoping would allow me to move an object by snapping to it's insert and then snapping to a nearest point on a line, while retaining the z value of it's original position. Snap to insert works but then osnap seems to revert to OSM before I try to snap to nearest. I don't really fully understand all the syntax of -
(command "_.move" ss "_non" "" bp ".Z" "_non" bp)
which I copied from another forum post.
Any help appreciated.
Thanks.