How to Rename Assemblies (Part Assemblies) in sequence following a line

Hi Team,

I could do my Dynamo script to rename my assemblies in Revit; however, at the moment, it doesn’t follow an order.

I want to manipulate the sequence of the rename following a line, for example, as per the image, starting with a sequence where the blue dot is placed and continuing the sequence as per the red line.

My script below :smiling_face_with_tear:"(

I hope you can help me guys

Cheers

Something to try:

  • Build a polycurve of the perimeter curve.
  • Find the parameter on that curve where the blue dot by pulling it’s location and using a Curve.ParameterAtPoint node.
  • Find the parameter for every assembly’s location point.
  • Test each of the assembly parameters for being less than the blue dot.
  • Use an If node and a + node to add one to any assembly parameter which was less than the blue dot’s parameter.
  • Use a List.SoetByKey to sort the assemblies by the adjusted parameters.
  • Rename the assemblies.
1 Like

sorry mate I dont get it, how i can do this from my script?

To clarify, would putting a value in a parameter solve your problem or must it be renamed?

Must be Renamed. like this


The name of the assembly

So in this example… DH1?

yes the part name(Assembly). I figure out to rename them but I want to make it in sequence following a line

cheers

If you dont understand what jacob is saying above then you could use this to help you.

Thanks, ill have a look

I checked the video, and it looks like this tool does not have an assembly in its category options, but I think I can do this with a spline from Dynamo.

thanks

Correct, the idea is to use it as inspiration / modifications to suit your requirements.

Try the below and post where you get stuck. I’m fairly sure that I am using node names which you can search for in this descriptions so you can figure it out with this if you put in the effort.


First draw the perimeter curves. Doesn’t matter how, but they have to be one continuous polycurve. I would likely use select model elements to pick four model curves.

From there get the location point of the assembly. You have this in your graph.

From there select the blue point. Again, this could be a ‘select model element’, and once you have that pull it’s location point.

From there get the parameter for each assembly location point on the PolyCurve using a Curve.ParameterAtPoint node.

After that use Curve.ParameterAtPoint to find the parameter for the blue dot point.

Now use a < node to find out which parameters from the assembly points are less than the parameter from the blue dot.

Next use an if node to return 1 for any true value, and 0 for any false value from the < node.

Next use a + node to add the 1 or 0 to the associated parameter from the Curve.ParameterAtPoint node. The lowest value in the list should be near to the blue point parameter, and the highest should be near to one more than the blue point parameter.

Next use a List.SortByKey to sort the assemblies themselves by the parameter values.

Finally rename the resorted assemblies as you currently are.

2 Likes

Hi Mate,

I have dedicated some time to checking nodes and another post, and I think I made some progress; however, I’m still stuck

In revit looks to select the spline and the assemblies and intersecting, but I still don’t get that in Dynamo

Cheers

anyone???

Hi @break113 do you have a sample rvt we can try on ??

bu ti would try something here

Hi @sovitek ,

I’m closer to the solution. It’s still not working, but now I can see in the model the spline shows the intersections with the assemblies, and apparently, the rename is correct; however, it is not updating the rename in the Revit model.


Thanks

R24ENG_2.18_RENAME ASSEMBLIES2.0.dyn (52.1 KB)

the revit file is too bif to upload here but
here is the link to download it

Hi @break113 you have 3 DH-1 and we cant rename this type so the have unique type nameas this is the same assembly, but here is a way there probably can work…

type nameseqHome.dyn (65.1 KB)

Hi @sovitek ,

I gave it a go, and it looks like now, select all the elements apart from the assemblies and mark errors in the nodes; from your side, run well?

Thanks
Alejandro

¨Yeah works fine her, be sure you select the right way

Revit_p0vlHhf9a5

another way could probably be with assembly.rename from steamnodes