BooleanOperationsUtils.ExecuteBooleanOperation throws InvalidOperationException

BooleanOperationsUtils.ExecuteBooleanOperation throws InvalidOperationException

FRFR1426
Collaborator Collaborator
1,598 Views
5 Replies
Message 1 of 6

BooleanOperationsUtils.ExecuteBooleanOperation throws InvalidOperationException

FRFR1426
Collaborator
Collaborator

I'm trying to compute the intersection between two solids (one coming from a wall, one I'm creating myself withCreateExtrusionGeometry). It works fine for the majority of walls, but on some, ExecuteBooleanOperation throws an InvalidOperationException :

 

GeometryElement geometryElement;
using (var options = new Options())
{
    geometryElement = wall.get_Geometry(options);
}
Solid wallSolid = null;
foreach (GeometryObject geometryObject in geometryElement)
{
    wallSolid = geometryObject as Solid;
    if (null != wallSolid) break;
}
using (Solid box = GeometryCreationUtilities.CreateExtrusionGeometry(curveloops,
        XYZ.BasisZ, height))
{
        intersection = BooleanOperationsUtils.ExecuteBooleanOperation(box, wallSolid,
            BooleanOperationsType.Intersect);

}

The only characteristic of the walls in question is that they are not parallel to the X and Y axes.

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Accepted solutions (1)
1,599 Views
5 Replies
Replies (5)
Message 2 of 6

Joe.Ye
Alumni
Alumni

 

Hello,

 

I don't think parallel is the key cause. Can you make sure that the two solids are not null?  

This this doesn't solve the issue, please upload a minium code project and a rvt model file to reproduce the issue.

Thank you!



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 3 of 6

FRFR1426
Collaborator
Collaborator

Hi Joe,

 

The two solids are not null. Here is an external command and a .rvt file for reproducing the issue: https://docs.google.com/file/d/0B_UzIApsl084RkE4ZWpxdC13cHM/edit?usp=sharing

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 4 of 6

Joe.Ye
Alumni
Alumni

 

The link seems not valid. Please fix this. 

 

Thank you!



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes
Message 5 of 6

FRFR1426
Collaborator
Collaborator

The link work for me. Please try this one:ftp://autodesk:VJitvmbob36QtlCrGamu@wiip.fr/BooleanOperationsTestCommand.zip

Maxence DELANNOY
Manager
Add-ins development for Autodesk software products
http://wiip.fr
0 Likes
Message 6 of 6

Joe.Ye
Alumni
Alumni
Accepted solution


With the shared model and code, I can reproduce the problem. the code itself looks no problem. Reported this to the internal engineering team.



Joe Ye
Contractor
Developer Technical Services
Autodesk Developer Network
0 Likes