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

Change thread length API Fusion 360

Anonymous

Change thread length API Fusion 360

Anonymous
Not applicable

Hello!
I create a thread and want it to be not the entire length of the cylinder, but a certain distance. In the documentation, I did not find an opportunity to set the thread length. Help, please, I am attaching the code for creating a thread in a hole.

how do i access the parameter given in the image ?? (Lenght)

 

threads = comp.features.threadFeatures
threadDataQuery = threads.threadDataQuery
defaultThreadType = threads.threadDataQuery.defaultMetricThreadType
threadClass = '6H'
threadDesignation = 'M3x0.5'
threadInfo = threads.createThreadInfo(True, defaultThreadType, threadDesignation, threadClass)
faces = adsk.core.ObjectCollection.create()
faces.add(sideFace)
threadInput = threads.createInput(faces, threadInfo)
threadInput.isFullLength = False
 thread = threads.add(threadInput)
0 Likes
Reply
Accepted solutions (1)
891 Views
5 Replies
Replies (5)

Anonymous
Not applicable

IMAGE

error.png

0 Likes

kandennti
Mentor
Mentor
Accepted solution

Hi @Anonymous .

 

Looking at this sample, it looks like this.

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-796D74F1-8DE9-43D9-84A5-6491A03D4574 

・・・
        threadInput.isFullLength = False
        threadInput.threadLength = adsk.core.ValueInput.createByReal(3.5)
・・・

 

0 Likes

2herds
Advocate
Advocate

I really am not sure about this, but I had thought the depth and thread specifications were set when "Thread" was picked in the thread set up window (pop-up). Toward the bottom of the thread window the length and size options are available. Again - this is just my thoughts and hopefully helpful.

0 Likes

kandennti
Mentor
Mentor

I may not understand it either.
Have you tried the sample here?

https://help.autodesk.com/view/fusion360/ENU/?guid=GUID-796D74F1-8DE9-43D9-84A5-6491A03D4574 

 

The result after running it looks like this.

1.png

 

0 Likes

Anonymous
Not applicable

Thanks a lot!

0 Likes