Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

crash when create extrusion with ToEntityExtentDefinition and construction plane

Anonymous
432 Views
1 Reply
Message 1 of 2

crash when create extrusion with ToEntityExtentDefinition and construction plane

Anonymous
Not applicable

I tried to run a C++ script.

Windows 8.1

Tried to create an extrusion with ToEntityExtentDefinition and a construction plane. Result: crash -> CER_179559361

Works fine with another body (body or BRepFace as "to" option).

Is it a known limitation?

 

{
	app = Application::get();
	ui = app->userInterface();

	Ptr<Documents> documents = app->documents();

	// create new file
	Ptr<Document> doc = documents->add(DocumentTypes::FusionDesignDocumentType);
	if (!doc) return false;

	Ptr<Design> design = app->activeProduct();
	Ptr<Component> root = design->rootComponent();
	root->isOriginFolderLightBulbOn(true);

	// create sketch
	Ptr<ConstructionPlane> xyCP = root->xYConstructionPlane(); 
	Ptr<Sketch> sketch = root->sketches()->add(xyCP);			
	if (!sketch) return false;

	// create circle => origin, radius=2
	Ptr<SketchCircle> circle0 = sketch->sketchCurves()->sketchCircles()->addByCenterRadius(Point3D::create(), 2);
	if (!circle0) return false;
	Ptr<Profile> circProfile = sketch->profiles()->item(0);				// profile of circle

	// create construction-plane to limit extrusion (toEntity)
	// parallel to xYConstructionPlane(), offset 5
	Ptr<ConstructionPlaneInput> cpInput = root->constructionPlanes()->createInput();
	cpInput->setByOffset(xyCP, ValueInput::createByReal(5));
	Ptr<ConstructionPlane> cpLimitForExtrusion = root->constructionPlanes()->add(cpInput);
	if (!cpLimitForExtrusion) return false;

	// create feature => from sketch-plane to construction-plane
	Ptr<ExtrudeFeatureInput> extrInput = root->features()->extrudeFeatures()->createInput(circProfile,FeatureOperations::NewBodyFeatureOperation);
	if (!extrInput) return false;

	// x-check: works fine with <DistanceExtentDefinition>
	/*
	Ptr<DistanceExtentDefinition> distExtDef = adsk::fusion::DistanceExtentDefinition::create(ValueInput::createByReal(2));
	extrInput->setOneSideExtent(distExtDef, ExtentDirections::PositiveExtentDirection);
	Ptr<ExtrudeFeature> extrude0 = root->features()->extrudeFeatures()->add(extrInput);
	if (!extrude0) return false;
	*/

	// the following version creates crash


	// extrusion "to" construction-plane => <ToEntityExtentDefinition> 
	Ptr<ToEntityExtentDefinition> toEntExtDef = adsk::fusion::ToEntityExtentDefinition::create(cpLimitForExtrusion, true);
	if (!toEntExtDef) return false;

	extrInput->setOneSideExtent(toEntExtDef,ExtentDirections::PositiveExtentDirection);
	Ptr<ExtrudeFeature> extrude0 = root->features()->extrudeFeatures()->add(extrInput);
	if (!extrude0) return false;
	
	/*
	// this one also creates crash
	extrInput->setOneSideToExtent(cpLimitForExtrusion, true, Vector3D::create(0, 0, 1));
	Ptr<ExtrudeFeature> extrude0 = root->features()->extrudeFeatures()->add(extrInput);
	if (!extrude0) return false;
	*/

	return true;
}
Reply
Reply
1 Like
433 Views
1 Reply
Reply (1)
Message 2 of 2

goyals
Autodesk
Autodesk

Thank you for posting it. I am able to reproduce the crash and we will resolve it early. Just to let you know this crash is happening only if you are using the workplane as "ToExtent" entity. Please keep sharing your feedback with us.



Shyam Goyal
Sr. Software Dev. Manager
Reply
Reply
3 Likes