An very interesting problem

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

Reply to
V.Tabakov
Loading thread data ...

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:

  1. Loop over the face vertices computing the extrema.
  2. Loop over the face edges computing curve extrema that lie inside the parameter range for the edge.
  3. 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:

  1. Call Edge::GetCurve to get the edge curve
  2. Call Edge::GetCurveParams2 to get the start and end parameters of the curve on the edge.
  3. 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

Reply to
Paul Delhanty

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

Reply to
kellnerp

thanks a lot

Reply to
V.Tabakov

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.