Programtic PolyLine Creation

Discussion in 'SolidWorks' started by dominic.albanese, Oct 6, 2005.

  1. Curious if anyone could give me some direction in creating polylines in
    solidworks with similar functionality to AutoCad.

    Just opening the files is not an option because i want to just do that
    math and make native entities...

    I am bringing in data from an outside source (Excel, igs etc.) and
    getting the data (using the API) in is no problem, but there doesnt
    seem to be a polyline command in Sworks.

    Here is what i have tried so far.

    I can create a bunch of lines, but i dont like the idea of all the
    redundant data, and not being able to treat the entities as a group.
    Not to mention that these polylines are up to several thousad points,
    and to create a composite curve you need each in a seperate sketch.

    The most promising so far is to use a spline. In the API i can control
    the order to 2 (linear) and set the control points to the data points.
    But manipulating this spline (dragging, deleting etc.) cause extremely
    erratic results.

    Am i missing something in the spline API commands? Thanks.

    Dominic
     
    dominic.albanese, Oct 6, 2005
    #1
  2. dominic.albanese

    Brian Guest

    Try this ( sorry, can't help with the api specifics )
    As long as the data that you are importing is in a consistant order ( ie for
    _AB_ and _CD_, points B and C are identical and not A C or B D if that
    makes sense), read in only the first point for each linear entity and create
    fixed points that coorespond to their location. Then ,via the api, create a
    spline and loop through each point connecting them ( for/next? ). That
    should give you one long continuous spline with more predictable behavior,
    and the ability to control curvature around each infleciton point, if
    necessary.


    If the endpoint data is too random, Create individual lines, then points
    coincident to each midpoint and loop through those points.
     
    Brian, Oct 6, 2005
    #2
  3. You might try using the ModelDoc2::InsertCurveFile set of commands. I
    used this once when I had a grid of points to make a whole bunch of 3d
    curves and then loft a surface over the curves. Basically, you call
    InsertCurveFileBegin, then call InsertCurveFilePoint(x, y, z) for all
    your points, then call InsertCurveFileEnd.

    Jonathan Anderson
     
    Jonathan Anderson, Oct 6, 2005
    #3
  4. dominic.albanese

    dudi Guest

    Hi
    There is no ployline equivalent in solidworks.
    There are splines.curves,composite curve but not polylines .
    Frankly it is not very much needed in solid modeling.

    regards dudi peer
     
    dudi, Oct 6, 2005
    #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.