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: 

Bodies to components

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
brad.bylls
185 Views, 6 Replies

Bodies to components

I have created the attached file to create the plastic injection mold base as shown below.

I now realize that all of the bodies should actually be components inside of the 88B Mold Base component.

Can somebody please point me in the right direction on how to change my code, or do I have to start over from scratch?

Any help is appreciated. Thank you.

Base.png

Brad Bylls
6 REPLIES 6
Message 2 of 7
kandennti
in reply to: brad.bylls

Message 3 of 7
PinRudolf
in reply to: brad.bylls

Actually, Kandenti's solution looks perfect. 

 

I haven't looked at your code but this does not sound like a huge change... 

 

For each component:

  1. Activate the main assembly
  2. Create a component 
  3. Activate the new component
  4. Create the body
Message 4 of 7
brad.bylls
in reply to: PinRudolf

I need to do this through the add-in code. That's where I am lost.
Brad Bylls
Message 5 of 7
kandennti
in reply to: brad.bylls

@brad.bylls .

 

I have not been able to confirm this because I cannot run it by itself.

・・・
	def on_execute(self, command, inputs, args, input_values):
・・・
		# Create the mold base.
		baseComp = drawBase(des, numPlateAthickness, numPlateBthickness, numRiserCheight, \
・・・

        # Componentization by body
		for body in baseComp.bRepBodies:
			body.createComponent()

		if baseComp:
			desc = _inputSelectBaseSize + ' Mold Base'
			baseComp.description = desc
・・・
Message 6 of 7
brad.bylls
in reply to: kandennti

Thanks Kandennti.

I am not exactly sure what is going on here, but I will try and work it out.

Brad Bylls
Message 7 of 7
brad.bylls
in reply to: kandennti

Thanks Kandennti.

I'll have a look and see what I can work out.

Brad Bylls

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