Problem with extrude-cut through all entities

Problem with extrude-cut through all entities

Anonymous
Not applicable
455 Views
2 Replies
Message 1 of 3

Problem with extrude-cut through all entities

Anonymous
Not applicable

I want to create cut extrude through all objects. I tried to use ThroughAllExtentDefinition but it's not working because it returns NULL when I try to create extrude with this options.

 

 

Ptr<ExtrudeFeatureInput> extrudeInput = extrudes->createInput(profile, FeatureOperations::CutFeatureOperation);

Ptr<ThroughAllExtentDefinition> throughAll = ThroughAllExtentDefinition::create();
extrudeInput->setOneSideExtent(throughAll, ExtentDirections::NegativeExtentDirection);

Ptr<ExtrudeFeature> extrude = extrudes->add(extrudeInput);

 

 

I've tried to switch ExtentDirections from NegativeExtentDirection to PositiveExtentDirection, but it's still no working.

 

 

Ptr<ExtrudeFeatureInput> extrudeInput = extrudes->createInput(profile, FeatureOperations::CutFeatureOperation);

Ptr<ThroughAllExtentDefinition> throughAll = ThroughAllExtentDefinition::create();
extrudeInput->setOneSideExtent(throughAll, ExtentDirections::PositiveExtentDirection);

Ptr<ExtrudeFeature> extrude = extrudes->add(extrudeInput);

 

 

Its working when I am changing ThroughAllExtentDefinition to DistanceExtentDefinition with -100000 value, but I need make cut through all entities. 

 

 

Ptr<ExtrudeFeatureInput> extrudeInput = extrudes->createInput(profile, FeatureOperations::CutFeatureOperation);

Ptr<ValueInput> distance = ValueInput::createByReal(-100000);
Ptr<DistanceExtentDefinition> distanceExtentDef = DistanceExtentDefinition::create(distance);
extrudeInput->setOneSideExtent(distanceExtentDef, ExtentDirections::PositiveExtentDirection);

Ptr<ExtrudeFeature> extrude = extrudes->add(extrudeInput);

 

What's the correct way to create Extrude Cut with ThroughAllExtentDefinition? Appreciate any help. Thanks.

0 Likes
456 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable

I suggest you check the error code.

If (!ln)
{
    // get error message
    std::string errorMessage;
    int errorCode = app->getLastError(&errorMessage);
    if (GenericErrors::Ok != errorCode)
        ui->messageBox(errorMessage);
    return false;
}

(Cribbed from here:- https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-ECC0A398-4D89-4776-A054-F7B432F7FCF6#Handlin...)

 

It may give you a clue as to why it isn't working.

0 Likes
Message 3 of 3

Anonymous
Not applicable

Thanks for your reply, but the code didn't return any error message.

0 Likes