I'wondering is out there a way to get the heights, lengths and etc for the faces or entities in solidworks 2003 partdocument by using The api functions and objects with VB . the only condition is that this must be done without using the displaydimensin functions.
I had searched all the net to find some scripts but unsuccessfully.
thank's for reading my note
Didn't find your answer? Ask the community — no account required.
P
Paul Delhanty
You can get the area of a face by called Face2::GetArea.
You can get the bounding box of a face by calling Face2::GetBox. The returned box should be large enough to contain the face, but it may be larger, sometimes a lot larger. A rough value could be obtained reasonably simply from the face tesselation used by SW for display purposes - call Face2::GetTessTriangles and loop over the triangles calculating the extreme values. If you want the exact height, length etc. of a face in a fixed direction in 3D, then you probably would have to write your own algorithm:
Loop over the face vertices computing the extrema.
Loop over the face edges computing curve extrema that lie inside the parameter range for the edge.
Find all exterma on the face surface that lie inside the face boundaries.
The dimension is then computed from the union of all the extrema.
If you need the length of an edge indirectly as follows:
Call Edge::GetCurve to get the edge curve
Call Edge::GetCurveParams2 to get the start and end parameters of the curve on the edge.
Curve::GetLength2, passing in the start and end parameters.
There is a C++ example in the API documentation called Get Edge Data by Name Example (C++ COM) that you should be able to convert to VB
K
kellnerp
Two places to look.
First look in the examples in the API help.
Then log onto the SW web site and browse the API support area. There is a presentation given by Trevor D. regarding BREP representation in SW that may give you some ideas.
When it comes right down to it SW is creat> I'wondering is out there a way to get the heights, lengths and etc for > the
V
V.Tabakov
thanks a lot
Join the Discussion
Have something to add? Share your thoughts — no account required.
Didn't find your answer?
Ask the community — no account required
Report Content
You are reporting this content to the moderators. They will look at it
ASAP.