An very interesting problem

Discussion in 'SolidWorks' started by V.Tabakov, Nov 25, 2003.

  1. V.Tabakov

    V.Tabakov Guest

    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
     
    V.Tabakov, Nov 25, 2003
    #1
  2. 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
     
    Paul Delhanty, Nov 25, 2003
    #2
  3. V.Tabakov

    kellnerp Guest

    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 creating geometry in a space symmetric
    about the origin and 1 km on a side. Things like points will be reported in
    this space if you record a macro and do certain operations.
     
    kellnerp, Nov 26, 2003
    #3
  4. V.Tabakov

    V.Tabakov Guest

    thanks a lot
     
    V.Tabakov, Nov 26, 2003
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.