Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Changing the end point of a curve

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
ahmadkhalaf7892
304 Views, 5 Replies

Changing the end point of a curve

Hi Guys , 
Is it possible to change the end point of a specific Curve,if it is what is the specific method ?  

5 REPLIES 5
Message 2 of 6
Message 3 of 6
Message 4 of 6

Hi Jeremy, it's a line Curve, I have two lines that are close to each other, Line[A] and Line [A+1} I am trying to make the Line[A] have the same end point as the start point of line[A+1], any idea how I can make that ?
Thank you
Message 5 of 6

Hi @ahmadkhalaf7892 ,

 

You can use SetGeometryCurve().

Here is the sample code

 ModelLine modelLine1;
                ModelLine modelLine2;

                Line lineA = modelLine1.GeometryCurve as Line;
                Line lineB = modelLine2.GeometryCurve as Line;

                XYZ startPtA = lineA.GetEndPoint(0);
                XYZ endPtA= lineA.GetEndPoint(1);

                XYZ startPtB = lineB.GetEndPoint(0);
                XYZ endPtB = lineB.GetEndPoint(1);

                // Get Line A endPoint and set it to startpoint of line B
                endPtA = startPtB;
               
                Line newLine = Line.CreateBound(startPtA,endPtA);
                modelLine1.SetGeometryCurve(newLine, true);

Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

Message 6 of 6

Thank you

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Customer Advisory Groups


Rail Community