If you are getting the x/y/z values as strings [perhaps from an imported text file] then
` z=z+'.m'
4.5.m ### as a string
eval(z)
177.165354330709 ### in inches [SUp's base units and used to position the point]if they are as floats then z=z.m` will work to convert it...
You could also look at model.raytest
The point could be one that you used for your vertical edge and the vector is [0,0,-1]
It will return any array raytest[0] is the intersection point and raytest[1][-1] is the face or edge it hits...
http://code.google.com/apis/sketchup/docs/ourdoc/model.html#raytest
@chris fullmer said:
because you are finding the bounding box for the first entitiy in the list of entities. What you want is to find the bounding box of the first entitiy in the selection set I would bet.
model = Sketchup.active_model sel = model.selection first_entity = sel[0]
try that
i got it ,thank u
~
You probably want to look into the PolygonMesh class as well. if you use face.mesh - it willl return a PolygonMesh for that face. The PolygonMesh is triangualted.
I got a plugin that let you hover over a face and visually see the PolygonMesh representation of that face: http://forums.sketchucation.com/viewtopic.php?f=323&t=21472
You can also use the SKP "Simple Extrension" API to put your tree structure into a C++ list box.
Here is a sample we use to display component categories and select components for placement.
(click on image to remove scroll bars)
[image: MVsq_tree.jpg]
@chris fullmer said:
I'm amazed that you keep coming back to the observer's Thom They have caused you so much pain already.
well... that's the part I haven't done yet. there is an issue with the area calculation SU does when you have skewed groups/components. haven't gotten to the part of adding the observers yet. But I dread it. I've yet not dared to go back to DoubleCut.
@thomthom said:
@mcdull said:
i have solved the problem ,thank u
And what was it?
when i generate 3d wall,some points are not planar.i have changed the function.