How to cut multiple entities using single solid

How to cut multiple entities using single solid

Anonymous
Not applicable
546 Views
1 Reply
Message 1 of 2

How to cut multiple entities using single solid

Anonymous
Not applicable

I have multiple solids placed over one other. I am solid another solid which cuts through the solids placed over one another.

 

If I use BooleanSubtract API, I can only cut single solid with single solid. I tried using acedssGet for creating a set of solid but I dont know how I cannot use the setname to cut through the solids.

 

How can cut through multiple solids at a single time using single entity?

0 Likes
Accepted solutions (1)
547 Views
1 Reply
Reply (1)
Message 2 of 2

tbrammer
Advisor
Advisor
Accepted solution

I suppose that you always subtract the same AcDb3dSolid from all plates. This is the problem:

The boolean operations modifies the AcDb3dSolid that you use for subtraction. Its internal geometry will be empty after the subtraction.

So what you need to do is to clone the entity you want to subtract and subtract the clone like this:

 

AcDb3dSolid *pSolidCopy = AcDb3dSolid::cast(pSolid->clone());
es = pSolidPlate->booleanOper(AcDb::kBoolSubtract, pSolidCopy);
delete pSolidCopy;

 

Note that you have to  delete the Clone when you are done with it because it is not database resident.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.