Add-in to add custom threads

Add-in to add custom threads

tjslo
Contributor Contributor
1,424 Views
3 Replies
Message 1 of 4

Add-in to add custom threads

tjslo
Contributor
Contributor

Hi,

I've got some custom threads that I often need to use in Fusion360. I know that they can be added to the Thread command with this technique, but I'm getting a bit fed up of having to do that every time Fusion is updated (3 times this week for me). Is this something that I can put into an add-in so that I can install them in a more-friendly manner than copying the .xml file out of my Git repo into the depths of the Fusion360 install? 

 

I'm relatively comfortable cobbling together scripts in Python, and have programming experience elsewhere but it's not clear to me whether the API has this capability. Can it?

0 Likes
Accepted solutions (2)
1,425 Views
3 Replies
Replies (3)
Message 2 of 4

kandennti
Mentor
Mentor
Accepted solution

Hi @tjslo .

 

There is a part in the library published by @thomasa88 that uses an excellent method to get the folder path.

https://github.com/thomasa88/fusion360-thomasa88lib/blob/master/utils.py#L67 

 

If you use this method, you should be able to get the correct path even after the update.
I think this is the way to go for the ThreadData folder.

        threadDataFolder = app.userInterface.workspaces.itemById('FusionSolidEnvironment').resourceFolder.replace(
            '/UI/FusionUI/Resources/Environment/Model', '/Server/Fusion/Configuration/ThreadData')

 

I think you can check if the xml file exists, and if not, you can copy it.

0 Likes
Message 3 of 4

thomasa88
Advocate
Advocate
Accepted solution

There's also https://github.com/thomasa88/ThreadKeeper

 

I got a report that the installer on the autodesk site might install a broken version. Due to an injury I can't do any work at the moment, but the github should work fine. (Be sure to download a release or do submodule update).

Message 4 of 4

tjslo
Contributor
Contributor

Thanks both. I've marked both these answers as solutions because @thomasa88 's ThreadKeeper is basically the same as the thing that I was in the process of writing using @kandennti 's advice. @thomasa88 your solution is definitely the most elegant (and quickest since there's no work for me). Good stuff.

0 Likes