Combine multible Modellines

Combine multible Modellines

Anonymous
Not applicable
649 Views
5 Replies
Message 1 of 6

Combine multible Modellines

Anonymous
Not applicable

Hi,


i am new to Revit API programming and was wondering if there is a possibility to combine multible modellines.
Via uiApp.ActiveUIDocument.Selection i have the option to pick modellines and get access to the geometry of each element (with LocationCurve) as shown below:

var pickedRefs = selLine.PickObjects(ObjectType.Element, new ModellineFilter(), "Pick Modellines.");

foreach (var refer in pickedRefs)
{
   var elementCurve = doc.GetElement(refer);
   var locationCurve = elementCurve.Location as LocationCurve;
   Curve curve = locationCurve.Curve;
// ? }


Now i want to combine those curves to one single curve element, so that i can access the complete geometry and be able to use curve methods like curve.length. It should also be possible to set referencepoints according to the entire curve via PointLocationOnCurve.


I hope there is an opportunity to realize this kind of conversion via the Revit-API.

0 Likes
650 Views
5 Replies
Replies (5)
Message 2 of 6

recepagah12
Advocate
Advocate

Can you be more specific and tell what is the state of model lines?

Are they straight, curve or there is space between them?

0 Likes
Message 3 of 6

Anonymous
Not applicable

There is no space between the model lines and there are both straight lines and curved lines.

0 Likes
Message 4 of 6

Anonymous
Not applicable

For instance like those modellinesFor instance like those modellines

0 Likes
Message 5 of 6

TripleM-Dev.net
Advisor
Advisor

Hi,

 

A Bit late,

Total length can be done by sum all of the curve.length's??

I've never used PointLocationOnCurve myself , but  can't you create a wrapper or separate class which takes multiple lines and returns the correct results (loop each line and evaluate what the app needs....)

 

Michel

0 Likes
Message 6 of 6

Anonymous
Not applicable
Thanks for your answer.
Yes sure i can add all curve.lengths together, to get the total length.
 
But this is not my main problem. I need one geometry reference of the whole curve object to place a reference point on a certain station and do other things with it.
If i would use a wrapper i'd have to calculate all geometry data & references of each curve segment by myself, which is in some cases impossible.

 

0 Likes