PDA

View Full Version : Is their another way to rotate a 3d plane...



Mc...
26th Apr 2006, 09:38 pm
Two requests from someone, myself, who dose not know all when it comes to 3D-Cad or computers but possibly more than is necessary or just enough to be dangerous.

Is their an easier way to rotate a 3d plane to lay flat to X-Y other than using Trigonometry to figure out the pitch and then use AutoCAD’s 3DRotate command to rotate the plane (it works but is time consuming)?

I’m building an actual model with printouts from a Cad model. I'm rotating 3D P-line Roofs from the cad model so that they lay flat and retain their true geometry on the X-Y plane. Is their an easier way to rotate a 3d plane to lay flat other than using Trigonometry to get the pitch/angle and AutoCAD’s 3DRotate command to rotate the roof plane? AutoCAD’s “Flatten” command from Express tools - smashes the 3D model exactly as you view it on the monitor (what you see on the screen and smash with “Flatten” becomes a 2D elevation on the 2D plane, not a true view - it does not keep the original geometry intact. ).

Also, I am looking for lisp routine or other easy way to get the angle of a 3D line short of using AutoCAD’s list command which gives way to much info, although it is easy to copy from for pasting into the command prompt. I found a lisp program that does this but it only gives a value rounded to the nearest whole number (not very accurate) and the percent of the slope, again rounded.

Thanks in advance, any ideas would be greatly appreciated?

Mc…

StykFacE
26th Apr 2006, 09:41 pm
what exactly are you trying to do with the 3D roof?

Mc...
26th Apr 2006, 10:07 pm
Most efficient way to rotate a 3d plane, so that it lays flat and retain its true geometry.

Ultimately, I’m building a Cardboard Model from a Cad Model - then printing the elevations on paper, then gluing them onto the board including the roof areas, then cutting them out and then gluing them together.

Mc...

CarlB
26th Apr 2006, 11:09 pm
The following lisp routine will give you the z angle of a line (angle relative to x-y plane). It reports angle in current angular units to a precision of 16 places.

You can use this to input an angle during an AutoCAD command- when prompted for angle, type 'zang (with apostrophe) to invoke it transparently, then pick a line.

Let me know if this does what you're looking for.



(defun c:zang ()
(setq AngUnits (getvar "aunits"))
(setq Obj (car (entsel "\nSelect line for z angle: ")))
(setq pt1 (cdr (assoc 10 (entget obj))))
(setq pt2 (cdr (assoc 11 (entget obj))))
(setq pt1xy (list (car pt1) (cadr pt1)))
(setq pt2xy (list (car pt2) (cadr pt2)))
(setq xydist (distance pt1xy pt2xy))
(setq delz (abs (- (caddr pt1) (caddr pt2))))
(setq zangle (atan delz xydist))
(angtos zangle angunits 16)
)

Mc...
27th Apr 2006, 02:53 am
Thanks CarlB, I put “zang.lsp” as you sent it into my special lisp collection, loaded it in the usual way into Autocad2000i and gave it the command “zang” drew a 3D 12:7 line tried “zang.lsp” on it and my god I got "30.25429896034312", your great – where did you find it? Did you write it? How much do I owe you? All I had to do is draw up a pretty little Icon for it.

I’m thinking that if I view directly down at the 3D roof plane so that I’m seeing it in its true view (true geometry on the X-Y-Z plane) and then use AutoCAD’s “Flatten” command, then I will get the most efficient method of arriving at the 2D geometry on the X-Y plane that I’m looking for, unless someone points me in a different direction?

Mc...

PS…If you were the writer, could you make it so that it pops up in a dialog box and gives the distance also…now that is asking for to much!
:cat:

fuccaro
27th Apr 2006, 04:54 am
Mc
You could align the UCS with the desired plane and copy the geometry to the clipboard. Return to the WCS and paste the clipboard content. :unsure: *Not tested*

CarlB
27th Apr 2006, 06:31 am
Mc,

Yo're welcome. Yes I wrote it to give you a hand, it was a little diversion/challenge for me. your thanks are enough :)

I was hoping that this would expeditie your 3drotatioon - that is during the command, when you are prompted for a rotation angle, instead of typing in an angle you would type 'zang, then select a line; the zangle would then be supplied to the command to complete the rotation.

Having a dialogue box pop up may interefere with its transparent use (during a command).

But if you want to try, it this version will pop up with the angle then also show it on the command line:




;; Routine to return a line's angle from x-y plane
;; with Mc request for dialogue box result
;; by CarlB for CadTutor April 2006
(defun c:zang ()
(setq AngUnits (getvar "aunits"))
(setq Obj (car (entsel "\nSelect line for z angle: ")))
(setq pt1 (cdr (assoc 10 (entget obj))))
(setq pt2 (cdr (assoc 11 (entget obj))))
(setq pt1xy (list (car pt1) (cadr pt1)))
(setq pt2xy (list (car pt2) (cadr pt2)))
(setq xydist (distance pt1xy pt2xy))
(setq delz (abs (- (caddr pt1) (caddr pt2))))
(setq zangle (atan delz xydist))
(setq Zangstr (angtos zangle angunits 16))
(alert (strcat "\nAngle from x-y plane = " Zangstr))
Zangstr
)

hendie
27th Apr 2006, 08:21 am
I would just use the UCS command, use the NEW option and select the object.
UCS is now set to the object just selected, simple !

Centauri
1st May 2006, 06:41 am
I do this sort of thing quite a lot, and use the 3D align function - draw a square in plan view, then align your 3D object to it. You can then move the object off the square to align another one.

Cheers
Graeme