# Trim one surface with multiple curves

Using the Geometry.Trim node I managed to trim a surface with one curve. How should a set up the nodes so that I can trim one surface with multiple curves?

For the moment instead of one surface with 25 holes I get 25 surface with 1 hole…

I cannot figure out the correct node to use…

For the time being, you’re going to have to use a Python node, as in the attached example:

trimAll_test

Thank you!

I was trying this for hours, I almost got to the same script as you but I was missing the [0] after new_base = new_base.(circles[i], points[i]) …

Now I understand that new_base is not a surface but a list with one surface in it.

just as another exercise if you’re interested, I think you can do this with the while loop package on the package manager, or you might be able to to do it with the reduce node and some clever custom nodes.

Hi Michael,

Do you mind providing an example with the while loop package, if you’re not too busy? I’ve been trying to use it with no success.

Loops? We don’t need no stinking loops. Your trim operation will result in a pile of overlapping surfaces that all cover each others’s holes. You need to find all the areas that they share in common. That is, you need to intersect all of them.

trimSurface

I hope you don’t mind another option. From some time ago DesignScript imperative code is working, so we can make loops directly with DS code.

The text of the function definition:
def TrimWithAll (Su,CuT:var,RefP:var)
{
return=[Imperative]
{
SuTrimmed={};
SuTrimmed[0]=Su.Trim(CuT[0],RefP[0]);
N=1;
NCurv=Count(CuT);
while (N<(NCurv))
{
SuTrimmed[N]=SuTrimmed[N-1][0].Trim(CuT[N],RefP[N]);
N=N+1;
}
return=SuTrimmed[N-1][0];
}
}
Some notes:
-You have to deal with having to select a point from every curve, that in my opinion is a pain. In a case like this (circles) you can implement in the function to get the center point and have a function that only need the curves.
-The experience until now is that Dynamo is blazing fast managing several simple solids. If I would be you, I will extrude the circles and use difference. You have already solid commands that allow to make Boolean operation with several elements, and you can forget about the reference point. But obviously the element to be trimmed has to be a solid instead of a surface.

Hi Everyone,

I am trying to trim down a surface caused by the walls I have built in Revit. Basically the extruded surfaces should help to slice off the end of my surface that has intersected with the floor plate. Can this be achieved with the Geometry.Trim tool described above?

Hello Timothy Halvorson,

Thanks,

Ritesh

Revit Project:

Dynamo Definition:

The idea is to be able to use the walls as a boundary that can help to slice geometry or act as a trim boundary line.

I found a viable solution. Since regulations limit cameras only to corridors and the possibility of sensors in the rooms, I can develop my system array limited to Revit Room Boundary. I simply did a GetItemAtIndex to reference the room I want and then associate the correct cameras to that surface geometry. I can save out different Revit Adaptive Families depending on the design solution I want to have for the system.

Hello Timothy Halvorson,

I am glad that you found the solution.

Let me look at your files and will get back to you if I find any other solution.

Keep using Dynamo!

Thanks,

Ritesh

Hi Ritesh,

Thanks for the willingness to help! I will definitely continue to use Dynamo and I have been spreading the word about this awesome new program in my school at North Dakota State University. I’m planning to have this be an integral part of my Thesis design process. Keep up the great work!

-Tim

Hello,

Is it possible to share the .dyn file? Somehow, the image is not readable for me.

Hello @Decognito …you could offcourse be lucky…but this topic is actuelly 7 years old…I would make a new one