How to change direction of the thread?

How to change direction of the thread?

Anonymous
Not applicable
1,200 Views
2 Replies
Message 1 of 3

How to change direction of the thread?

Anonymous
Not applicable

Hello guys! 
I have a couple of problems with making a thread of the bolt. 

I made a thread on the face of the bolt, but the problem is that it starts from top. 
2.png

But I want to make thread that starts from the bottom. 

I tried to created an offset parameter but it's a little bit incorrect for me. 

I really hope you might know the prorperty which can solve that kind of problem. 

1.png

Here's part of the code: 

 

 if num1 == 1:
                    dThreadBolt77= d_bolt77[:-3]
                    threads77 = [('8', '1.25', '22 mm', '8 mm'), ('10', '1.5', '26 mm', '13 mm'), ('12', '1.75', '30 mm', ''), ('16', '2', '38 mm'), ('20', '2.5', '46 mm'), ('24','3', '54 mm')]
                    for i in range(0, len(threads77)): 
                        if threads77[i][0] == dThreadBolt77:
                            threadPitch77 = threads77[i][1]

                    compBolt77 = components.itemByName('3 БОЛТ ГОСТ 7796').bRepBodies.item(0)
                    componentBolt77faces = compBolt77.faces
                    faceBolt77 = componentBolt77faces.item(2)
                    threadTypeBolt77 = "ISO Metric profile"
                    threadDesignationBolt77 = 'M'+ dThreadBolt77 + 'x' + threadPitch77
                    threadClassBolt77 = '6g'
                    threadFeaturesBolt77 = components.itemByName('3 БОЛТ ГОСТ 7796').features.threadFeatures
                    threadInfoBolt77 = threadFeaturesBolt77.createThreadInfo(False, threadTypeBolt77, threadDesignationBolt77, threadClassBolt77)  
                    threadInputBolt77 = threadFeaturesBolt77.createInput(faceBolt77, threadInfoBolt77)
                    threadInputBolt77.isFullLength = False
                    threadInputBolt77.threadLength = adsk.core.ValueInput.createByString(threads77[i][2])
                    threadBolt77 = threadFeaturesBolt77.add(threadInputBolt77)

 

0 Likes
1,201 Views
2 Replies
Replies (2)
Message 2 of 3

bharathkumaran26
Advocate
Advocate

Hi @Anonymous 

Kindly refer the link below.

 

https://knowledge.autodesk.com/community/screencast/f885f05c-0347-4b7b-8ee5-57b7b70b5599

 

If your problem is solved. Kindly click on 'Accept Solution'

 

 

Thanks & Regards

Bharath R K

1.jpg2.jpg3.jpg

 
0 Likes
Message 3 of 3

BrianEkins
Mentor
Mentor

I'm surprised this hasn't come up before because it looks like a big limitation.  I don't see a way to control which end of the cylinder the thread starts from for a partial thread.  In the UI, you have some control because it infers the end by which end you're nearest when you select the cylinder.  However, if you need to change the direction for an existing thread it doesn't seem possible.  In the API, you only provide the cylinder so there's no opportunity to provide a point to infer the direction.

I did find that depending on the direction of my extrusion of the circle, the thread would be placed on one end or the other.  Not the best way to control it but it at least gives you something to try.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com