Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Check to see if opened part is a "Purchased Part"

isocam
Collaborator

Check to see if opened part is a "Purchased Part"

isocam
Collaborator
Collaborator

Can anybody help???

 

For testing purposes only!

 

I have opened a part that is stored in a Fusion 360 folder called "Purchased Parts\Gearboxes"

 

I need to check if the part that I have open has come from a "Purchased Parts" folder or not

 

Is it possible, using a Python script,  to show a message box stating "This is a purchased part" if the opened part has come from a "Purchased Parts" folder??

 

Many thanks in advance!

 

Darren

0 Likes
Reply
Accepted solutions (1)
201 Views
1 Reply
Reply (1)

kandennti
Mentor
Mentor
Accepted solution

Hi @isocam .

 

The hasTargetFolder function created here is designed to return True if the specified folder name exists in the document file path.

https://forums.autodesk.com/t5/fusion-360-api-and-scripts/extract-bom-add-folder-to-output/m-p/10510... 

 

        doc = app.activeDocument
        if hasTargetFolder('Purchased Parts', doc) and hasTargetFolder('Gearboxes', doc):
            ui.messageBox('bingo')

 

0 Likes