ExtractBOM - Modification

ExtractBOM - Modification

isocam
Collaborator Collaborator
358 Views
1 Reply
Message 1 of 2

ExtractBOM - Modification

isocam
Collaborator
Collaborator

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

 

 

0 Likes
359 Views
1 Reply
Reply (1)
Message 2 of 2

kandennti
Mentor
Mentor

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,
                })
・・・
0 Likes