Programtic PolyLine Creation

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

Reply to
dominic.albanese
Loading thread data ...

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.

Reply to
Brian

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

Reply to
Jonathan Anderson

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

Reply to
dudi

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.