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: 

Add-in to add custom threads

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
tjslo
281 Views, 3 Replies

Add-in to add custom threads

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?

3 REPLIES 3
Message 2 of 4
kandennti
in reply to: tjslo

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.

Message 3 of 4
thomasa88
in reply to: kandennti

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
in reply to: tjslo

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.

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