For some apllications I need my points, lines, arcs and curves to be in exactly Z=0. (Z=1.12345 10e15 won’t do.) Up to now I am using all the tricks I know to achieve this, like project, pull and the export options. However, before sending the file to my customer I want to be sure that all items in the file have Z=0.
Can anyone think of a lisp or macro to check this?
That would be very much appreciated!
Two alternatives which might work if you have not already tried them:
Select the desired objects
Set Z box checked (Set X and Set Y boxes not checked)
Align to World selected
In top view:
Reset CPlane to World Top
Select World option
Select Top option
Normally ProjectToCPlane from Top view should work… --Mitch
Don’t know if this script would work any better…
import rhinoscriptsyntax as rs objs=rs.GetObjects("Select objects to flatten",1+4,preselect=True) if objs: rs.EnableRedraw(False) xform=rs.XformPlanarProjection(rs.WorldXYPlane()) rs.TransformObjects(objs,xform,False)
Thanks for your quick answers.
Maybe I have to be more clearly:
In this case I don’t want to correct
I just want to check, and get the “Z= not 0” objects vissible (and selected) or listed or something.
Unfortunately, for all intents and purposes, Z=1.12345 10e-15 IS Zero. --Mitch
Here’s a simple script that checks it for you.
But do a double check to make sure it works perfectly. I just threw it together with out much error testing.
(It uses the bounding box and reacts at least if z=0.00000000001 )
Check if objects are flat on XY.py (505 Bytes)
Here is one more attempt ( Python script )
import rhinoscriptsyntax as rs obs = rs.GetObjects( 'Objects ?' ) cnt = 0 for ob in obs: rs.EnableObjectGrips( ob, True ) pts = rs.ObjectGripLocations( ob ) rs.EnableObjectGrips( ob, False ) for pt in pts: if pt.Z != 0.0: rs.SelectObject( ob ) cnt += 1 break print( '%d objects have been selected' % cnt )
This seems to work excelent !!
Thank you both guess !!