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: 

ExtractBOM - Modification

1 REPLY 1
Reply
Message 1 of 2
isocam
97 Views, 1 Reply

ExtractBOM - Modification

Can anybody help?

 

I need the Python script checking/modifying. Please see:

 

Solved: Extract BOM - Add Folder To Output - Autodesk Community - Fusion 360

 

I need the following modification:

 

The script outputs the part version. For example, part number 12345 gets outputted as 12345 v32

 

I only need it to output the part number only. Can this be done?

 

Please also see the bottom of the link as I need to output the folder name only (in this case "BIL Castors).

 

Many thanks in advance!

 

Darren

 

 

1 REPLY 1
Message 2 of 2
kandennti
in reply to: isocam

Hi @isocam .

 

I overlooked it.
How about this?

import adsk.core, adsk.fusion, traceback
import re #<-Here

def walkThrough(bom):
・・・
def run(context):
    ui = None
・・・
                bom.append({
                    'instances': 1,
                    'component': comp,
                    'name': re.split(' v\d+', comp.name)[0], #<-Here
                    'description': comp.description,
                    'folderName': folderName,
                })
・・・

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