Poll

Which software is best? Not counting the big boys "PDMS, SMARTPLANT & PDS"

AutoCAD Plant3D
0 (0%)
Bentley AutoPlant
0 (0%)
Intergraph CadWORX
0 (0%)
Inventor
1 (50%)
Solidworks
1 (50%)
Cadpipe
0 (0%)

Total Members Voted: 2

Voting closed: November 16, 2010, 10:27:26 PM

Author Topic: 3D Move and Rotate that needs a little help TLC  (Read 842 times)

0 Members and 1 Guest are viewing this topic.

laison

  • Guest
3D Move and Rotate that needs a little help TLC
« on: November 09, 2010, 10:27:26 PM »
;;Moves and object in a parallel plane of another until it is perpendicular
;;to it then rotates 1st object so that it lines up with it. Made for 3D Similar to
;;align command.
;;Written by Laison Albarado 11-09-2011   
(defun c:mr (/ pt1 pt2 pt3 pt4 pt0 ang1 dst1)
   (setq os (getvar "OSMODE"))
   (setvar "OSMODE" (logior os 1 2 4 32 128 8192))
   (setq pt1 (getpoint "\nSelect 1st object: "))
   (setq pt2 (getpoint pt1 "\nEnter second point: "))
   (setvar "OSMODE" (logior os 1 2 4 32 128 8192))
   (Setq pt3 (getpoint pt1 "\nSelect Reference point/object: "))
      (command
            "move" pt1 pt2
   (setq ang1 (getangle pt1 pt3))
   (setq pt4 (polar pt2 ang1 dst1))
      (command
            "rotate" pt1 pt3
      )
)