Grounding component/occurrence

brad.bylls
Collaborator

Grounding component/occurrence

brad.bylls
Collaborator
Collaborator

How do you ground a component with the API?

I tried:

component.isGrounded = True

componentOcc.isGrounded = True

 

Doesn't work.

Any help appreciated.

Brad Bylls
0 Likes
Reply
Accepted solutions (3)
569 Views
4 Replies
Replies (4)

davemwhiteley
Explorer
Explorer
Accepted solution

Hi Brad,

I know it's been a while, but I came across your post with the same problem.,

You need to get the occurrence and ground that, i.e.

 

            product = app.activeProduct
            design = adsk.fusion.Design.cast(product)
            rootComp = design.rootComponent
            occ0 = rootComp.occurrences.itemByName('Box:3')
            occ0.isGrounded=True
 
I hope this helps?
0 Likes

brad.bylls
Collaborator
Collaborator
Accepted solution

Thank you Dave.

Brad Bylls
0 Likes

MichaelT_123
Advisor
Advisor
Accepted solution

Hi Mr Brad.Bylls

 

Consider looking into the few years old conversation:

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/i-am-isgrounded/m-p/7169797

 

I am not sure if the API ground is still the same, but ...

 

Regards

MichaelT

 

MichaelT
1 Like

brad.bylls
Collaborator
Collaborator

@MichaelT_123 

This what I ended up using at the time.

	root = design.rootComponent
	occ = root.occurrences.item(0)
	comp = occ.component
	subOcc1 = comp.occurrences.item(0)
	subOcc1Proxy = subOcc1.createForAssemblyContext(occ)
	subOcc1Proxy.isGrounded = True

Thanks for the input.

 

Brad

Brad Bylls
0 Likes