Combine two model line segments into one

I used Dynamo to combine two model line segments into one.
After successfully merging them in Dynamo, I tried to convert them into Revit objects.
However, the result was the same as the original model line segment, and the two model line segments were not combined into one.
How can I properly merge the model line segments and load them as instances into a Revit object as a single line?

We believe the cause of this is that when the PolyCurve is converted to Curve, the Curve is two
We believe that this is due to the fact that when the PolyCurve is converted back to a Curve
If you look at the PolyCurve, you will see that the number of curves is two.

I am thinking that in order to make it a Revit object, PolyCurve needs to be converted to Curve, but I am sad to say that after all the effort of joining them, when I make it a Revit object, one line is restored to two lines.

You should be able to use the PolyCurve to make a Revit object as a PolyCurve is just a subclass of Curve.

@Nick_Boyts
In other words, what exactly should be corrected?

Hello @miyo222 something here could probably work in some cases…

@sovitek With that program, I think it only connects the first and last points, but loses the middle point, which is not the line segment I want, what do you think?

1 Like

Could you show a sreenshot with your modelcurves In that situation

@sovitek
Here is a summary of what I want to tell you.
What do you think?

Looks like I misspoke. I thought Revit automatically converted the PolyCurve on import but it does not.

Revit does not allow PolyCurves but you can still import both lines and maintain the three points. It would help if we had a little more context for what you’re doing with the lines/points after import, but you can still get the points from the original curves. There should be no difference between maintaining the points/curves as a polycurve or individual curves.

1 Like

@Nick_Boyts
I would like to combine the two lines and have Revit recognize them as one line.

helo @miyo222 thats itsnt possible as far i know

@sovitek
I would like to use it as a path for a sweep, but it seems difficult.
Thank you very much.

arhh its for a sweep, then u could jus joint them and use the polyycurve as path

@sovitek How can I merge them?

polycurve by joined curves

I believe a sweep path is still a list of connected curves in the API, so it shouldn’t require combining the curves at all. Have you tried creating the sweep yet? Do you get any errors?

1 Like

yeps Nick…think actuelly you are right :wink:

@Nick_Boyts I would like to try it, but I am stuck because I don’t know what program to write.
I have two different profile families (A and B) on hand. What is the best program to place a profile called A at the start point and a profile family called B at the end point and extrude along the poly curve obtained from Revit?

I think you have three options. You either

  1. create the extrusion as Dynamo geometry and import it into Revit as a DirectShape.
  2. use the API to create an in-place family native to Revit.
  3. develop an adaptive family and use Dynamo to place/orient it.

The first option will likely be the easiest, especially if you’re unfamiliar with the Revit API, python, or adaptive families. The second and third options will give you an actual Revit object and are likely a better overall solution, but will require more work.

After some quick research however, it seems like the SweptBlend methods are still only available in the Family environment. So you could use Dynamo to create specific families and place them but that’s probably more work than necessary.