How to Extend start/end point of curve (wall location) API C# ?

How to Extend start/end point of curve (wall location) API C# ?

Anonymous
Not applicable
3,405 Views
2 Replies
Message 1 of 3

How to Extend start/end point of curve (wall location) API C# ?

Anonymous
Not applicable

Hello,

I am trying to shift/extend the End and Start point of a curve.

I get that curve from the wall.Location command.

In fact, I am currently transferring a program made on dynamo to External command with API Revit to integrate it in a plugin.

So, here's the question : Is there a function that allows me to do the equivalent of the Curve.ExtendStart or Curve.ExtendEnd node with the revit API in C #? If not, can you help me find a way to do something similar?

2020-05-06_17h36_18.png

I want an offset on my End/Start point equal to half the witdth of the wall from wich I get the curve.

So, here is what I did so far with my code (don't mind the french): 

 

foreach(Wall wall1 in WallList)
{
Double Width = wall1.Width;
Double ExtendDistance = Width / 2;
TaskDialog.Show("Info", "La largeur du voile est : " + Width+" et la largeur divisé par deux est de : "+ExtendDistance);
LocationCurve locationCurve = wall1.Location as LocationCurve;
Curve wallCurve = locationCurve.Curve as Curve;
//Insert Code (Extend end/start point of curve)
}

 

 

My goal is to automatically place a stiffener at the end/start of each wall.

2020-05-06_18h05_43.png

2020-04-14_17h45_13 (2).png

To do this, I need a point. I already know how to place and contrain a stiffener from a placement point. 

My concern is how to find said placement point.

Can you help me please,

I'm french please excuse the mistakes and clumsiness.

 

Cheers, Samuel

0 Likes
Accepted solutions (1)
3,406 Views
2 Replies
Replies (2)
Message 2 of 3

jeremytammik
Autodesk
Autodesk
Accepted solution

This question was recently discussed right here in the forum.

 

Please always search for existing answers before raising a new one. That will save a tremendous amount of time, both for you yourself and the rest of the universe. Thank you!

 

Here is the blog post summarising the results:

 

https://thebuildingcoder.typepad.com/blog/2020/02/adjusting-wall-location-curve-and-visual-presentat...

  

Best regards,

 

Jeremy

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thank you for your answer!
Ah yes, sorry about that, I am familiar with your blog, but I must have missed this page. I do think I found what I was looking for in your link, thanks a lot.

Best

0 Likes