Message 1 of 3
How to directly access thread paramters of a bolt using the API script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am working on bolt classification problem involving to generate a labelled dataset as a CAD classifier, I need to generate a dataset of 1000 different bolts with varying parameters like diameter, thread features like pitch , length of the bolt etc using an API script. I am facing difficulty in directly accessing the thread features using the script, since in the sample bolt script given on fusion, the thread features are accessed indirectly by this piece of code:
threads = newComp.features.threadFeatures
threadDataQuery = threads.threadDataQuery
defaultThreadType = threadDataQuery.defaultMetricThreadType
recommendData = threadDataQuery.recommendThreadData(self.bodyDiameter, False, defaultThreadType)
if recommendData[0] :
threadInfo = threads.createThreadInfo(False, defaultThreadType, recommendData[1], recommendData[2])
faces = adsk.core.ObjectCollection.create()
faces.add(sideFace)
threadInput = threads.createInput(faces, threadInfo)
threads.add(threadInput) I am looking for a way to somehow access the thread info, be able to look in what thread features are available and be able to choose from them in order to generate my dataset. It would be great if someone could help me out here with the API script for this