Community
Fusion API and Scripts
Got a new add-in to share? Need something specialized to be scripted? Ask questions or share what you’ve discovered with the community.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem with extrude-cut through all entities

2 REPLIES 2
Reply
Message 1 of 3
vcherkasN38J8
205 Views, 2 Replies

Problem with extrude-cut through all entities

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.

2 REPLIES 2
Message 2 of 3

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.

Message 3 of 3

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report