Bodies to components

Bodies to components

brad.bylls
Collaborator Collaborator
619 Views
6 Replies
Message 1 of 7

Bodies to components

brad.bylls
Collaborator
Collaborator

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
0 Likes
Accepted solutions (1)
620 Views
6 Replies
Replies (6)
Message 2 of 7

kandennti
Mentor
Mentor
0 Likes
Message 3 of 7

PinRudolf
Advocate
Advocate

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
0 Likes
Message 4 of 7

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

kandennti
Mentor
Mentor
Accepted solution

@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
・・・
0 Likes
Message 6 of 7

brad.bylls
Collaborator
Collaborator

Thanks Kandennti.

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

Brad Bylls
0 Likes
Message 7 of 7

brad.bylls
Collaborator
Collaborator

Thanks Kandennti.

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

Brad Bylls
0 Likes