CutGeometry tool from API? (Make it work with Walls against Walls)

Hello all.

I’m in need of cutting intersecting Walls (“ToBeCut” Wall is overlapped by a smaller “CutWith” of a different Wall type). The “Cut Geometry” tool, straight from the toolbar, does this without issues. Just select both Walls, and voila. However, the API functions I’ve found related to cutting intersecting elements won’t accept Wall elements. At least not the way I’ve tried…

Ej.:

InstanceVoidCutUtils.AddInstanceVoidCut()

Gives me the error: “The element is not a family instance with an unattached void that can cut.”

SolidSolidCutUtils.AddCutBetweenSolids()

Gives me the error: The element does not meet the condition that it must be solid and must be a GenericForm, GeomCombination, or a FamilyInstance.

So I guess neither of these are what the “Cut Geometry” tool does, which handles two Walls elements as “inputs” with no issues.

How can I find what’s the exact API function behind this tool?

Any leads would be appreciated. Thanks in advance.

1 Like

I was trying to do the same thing a while back but didn’t have much luck finding anything. I suspect either not in the API or it’s under something a bit funky so it isn’t immediately obvious.

Yeah, my theory is that the tool doesn’t work on a single function, it probably uses several, picked based on context, categories of elements involved, etc. Maybe some are accessible through API and others are not.
Anyway, thanks for confirming it’s not just me! Hopefully someone in the forum knows more.

Can you show how you do that?

wallcut

Thanks for clarifying!
That actually enbeds the wall and is possible only when they are coplanar and one is inside the other.
I don’t know of method in the API that can do that, I don’t think such method exists.
However I would try the following:

  1. Make a Curtain Wall type that gets embedded automatically:
  2. Place that wall type (or change the placed walls to that type).
  3. Change the type back to the one that you want.
    You might need a doc.Regenerate() between 2 and 3

Thanks! I’m starting to get used to workarounds like this.

Unfortunately, the temporary change to a Curtain Wall type removes all the inserts I had in the Walls, so I still have to figure out how to solve that part (probably list them and reinserting them). But as long as it’s doable and programmable, I’m good.

I’ll mark this a solution, as it solves the initial question.

Thanks again!

Glad to see that it worked (or sort of worked)!
I haven’t really tried it myself, but that was what could think of off the top of my head