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: 

Componet return 0 bodies

1 REPLY 1
SOLVED
Reply
Message 1 of 2
raterWBBQB
173 Views, 1 Reply

Componet return 0 bodies

Ptr<Profiles> profs = sketch2->profiles();
	Ptr<Profile> prof = profs->item(0);


	Ptr<RevolveFeatures> revolves = rootComp->features()->revolveFeatures();

	Ptr<RevolveFeatureInput> revInput = revolves->createInput(prof, sketchLine1, FeatureOperations::NewComponentFeatureOperation);

	Ptr<ValueInput> angle = ValueInput::createByReal(2.0*PI);
	revInput->setAngleExtent(false, angle);

	revolves->add(revInput);

	
	
	Ptr<BRepBodies> bodies = rootComp->bRepBodies();
	ui->messageBox(std::to_string(bodies->count()));
	if (!bodies) {
		ui->messageBox("bodies");
		return false;
	}
1 REPLY 1
Message 2 of 2
marshaltu
in reply to: raterWBBQB

Hello,

 

From the piece of codes you posted, it may be because new body is created in a sub component. You have to pass "FeatureOperations::NewBodyOperation" as argument if you want the new body in root component.

 

"

Ptr<RevolveFeatureInput> revInput = revolves->createInput(prof, sketchLine1, FeatureOperations::NewComponentFeatureOperation);

"

 

Thanks,

Marshal



Marshal Tu
Fusion 360 Developer
Autodesk, Inc.

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