Cancel
Showing results for 
Search instead for 
Did you mean: 

Tecnomatix API 13 Can't draw a curve

Experimenter
Experimenter

Greeting Everyone,

 

I am unable to draw a curve because the inner Array of points for the TxCurveCreationData object does not assign,

Example,

ArrayList list = new ArrayList();

//Populate List

TxCurveCreationData curveDat = new TxCurveCreationData();

curveDat.PointsList = list;

But nothing happens PointsList property is not assigned to the value of List,

And whe I try to create the curve naturally he says that the list is empty.

I have tried the same with TxPolylineCreationData it works with no problems.

 

Regards.

 

 

5 REPLIES

Re: Tecnomatix API 13 Can't draw a curve

Siemens Legend Siemens Legend
Siemens Legend

There's likely a bug in TxCurveCreationData.PointsList (get), so it always returns an empty list.

I recommend you report it in the usual channels so it gets fixed.

Setting the PointsList should work fine, even though you cannot "see" it afterwards.

If that still doesn't work, you might want tryusing the TxCurveCreationData constructor to set the list, e.g.:

ArrayList list = new ArrayList();

list.Add(new TxVector(0,0,0));

list.Add(new TxVector(1,1,1));

//Populate List

TxCurveCreationData curveDat = new TxCurveCreationData("curve1", list);

Re: Tecnomatix API 13 Can't draw a curve

Experimenter
Experimenter

I have tried that aswell, this is how it looks

Curve_1.curveShape returns a ArrayList

I only need the curve because polyline does not work with built in PS functions for 3D Modelling such as Merge Curves. 

Capture.PNG

 

Re: Tecnomatix API 13 Can't draw a curve

Siemens Legend Siemens Legend
Siemens Legend

This code seems to work for me just fine (Tecnomatix 14.0.2):

            ArrayList arr = new ArrayList();
            arr.Add(new TxVector(0, 0, 0));
            arr.Add(new TxVector(100, 100, 100));
            arr.Add(new TxVector(150, 150, 150));

            TxCurveCreationData crData = new TxCurveCreationData("myCurve", arr);
            TxComponent comp = TxApplication.ActiveDocument.PhysicalRoot.CreateLocalComponent(new TxLocalComponentCreationData("CurveComp"));
            TxCurve curve = comp.CreateCurve(crData);

Does it work for you?

Re: Tecnomatix API 13 Can't draw a curve

Experimenter
Experimenter

Yes this code works, but this code is of no use for my particular application,

I have a list of TxVectors (maximumu number is 3500 vectors) and it does not assing this list to the PointsList property.

I have tried to add them again to fresh list with a foreach just to see but it does not work,

Other option is to draw them as individual lines but codes like this throw me an exeption, maybe because that is too much data.

ArrayList newList = new ArrayList();

TxLineCreationData StraightLine = new TxLineCreationData();

StraightLine.StartPoint = newList[0] as TxVector;

foreach(TxVector i in newList)

{

StraightLine.EndPoint = i;

m_space.CreateLine(StraightLine);

StraightLine.StartPoint = i;

}

The only other option left is to try and draw an Arc, I am triying this right now.

I am using API version 13.

Very strange that when I create a TxPolyLineCreationData it works just fine, but when It adds the polyline to the currently modeled element PS throws an Error Message and does not allow to End Modelling.

 

Re: Tecnomatix API 13 Can't draw a curve

Experimenter
Experimenter

I have found out why it was not assigning, during calculation for some reason there where two identical TxVectors, probably during the assesments of the curve shape there was an error.

TxPolylineCreationData draws it anyway.

So if someone will encounter this in the future make sure that there are no identical TxVectors inside your List for the TxCurveCreationData.