I have this lisp file that will move objects in 2D & 3D. Once it is activated it asked for X, Y or Z planes. It works great. I want to add on to it are find another file that will move and rotate (align, turn, orientate) with another object in 3D just by selecting he object that I want to line up with, even though the distance is unknown, the angle is unknown.
Example:
I have this horizontal pipe with a tee in it that I need to connect to running north/south.
I am running another pipe a few feet over and above in the vertical with a tee pointing towards the tee.
After I add an (elbow,tee, whatever) I would like the fitting to move and align it's points just by selecting the destination point.
This would be a great time saver. I see many move, rotate but it is for 2D only. I HAVE LOOKED. Bentley Autoplant has this feature built in to there software. So I know that this is possible.
This is the code that I have:
;;; MPF.lsp Move Objects Along Axis
;;;Move objects with Point Filter in the X, Y or Z direction.
(defun C:MPF (/ dir)
(SETQ dir (Getstring "\nEnter Point Filter Direction:> X Y or Z: "))
(if (or (= dir "x") (= dir "X")) (MXX))
(if (or (= dir "y") (= dir "Y")) (MYY))
(if (or (= dir "z") (= dir "Z")) (MZZ))
)
(defun MXX (/ osm slset pt1 pt2)(terpri)
(prompt "MOVE with .X Filter")(terpri)
(setq slset (ssget))
(setq pt1 (getpoint "Select Base Point of Object to move:"))(terpri)
(setq pt2 (getpoint "Select destination .X of:"))(terpri)
(command ".move" slset "" pt1 ".X" pt2 "@") ;change @ to pause without the quotes to manually pick direction
)
(defun Myy (/ osm slset pt1 pt2)(terpri)
(prompt "MOVE with .Y Filter")(terpri)
(setq slset (ssget))
(setq pt1 (getpoint "Select Base Point of Object to move:"))(terpri)
(setq pt2 (getpoint "Select destination .Y of:"))(terpri)
(command ".move" slset "" pt1 ".Y" pt2 "@")
)
(defun Mzz (/ osm slset pt1 pt2)(terpri)
(prompt "MOVE with .Z Filter")(terpri)
(setq slset (ssget))
(setq pt1 (getpoint "Select Base Point of Object to move:"))(terpri)
(setq pt2 (getpoint "Select destination .Z of:"))(terpri)
(command ".move" slset "" pt1 ".Z" pt2 "@")
)
;****************
(prompt "Enter MPF to run program")(terpri)
<edit: CAB added code tags>