Straight line as ICurve_DG

Technical discussions
Post Reply
Joel_20
Posts: 1
Joined: Tue Dec 15, 2020 5:54 am

Straight line as ICurve_DG

Post by Joel_20 »

Hello guys
I am a newbie.
I need to make an edge IEdge_Dg straight. I see there is a SetCurve method, so the main question I have is how do I construct a straight line, which is actually a ICurve_DG?
Anything else I need to know to modify the edge?
Thanks heaps
Joel

Daniel Laajava
Posts: 4
Joined: Thu Jun 18, 2020 3:51 am

Re: Straight line as ICurve_DG

Post by Daniel Laajava »

Try this:

Code: Select all

 IModel_DG iModel;
 IObjectGenerator_DG gtr = iModel as IObjectGenerator_DG;
 ILine_DG line = gtr.Create("Line_DG") as ILine_DG;

 // Define the line like
 LineDg lineDg = new LineDg(1, 0, 0,  0, 0, 1);            //Position and direction. See C# examples for  LineDg. 
line.Init2(lineDg);

// Query the curve
ICurve_DG curv = line as ICurve_DG;
The line must contain vertices of the edge up to a tolerance. Normally you determine the vertex positions first and then define the line using line.Init1(pt0, pt1);

Post Reply