I am trying to add cosmetic threads to several holes in order to work around a Solidworks issue and would like to automate this with the API. I found the InsertCosmeticThread3 call and it is straight forward except when it comes to custom standards. We use a couple of custom standards here, but the swCosmeticStandardType_e enumerations doesn't really support custom standards. I set this value in the InsertCosmeticThread3 call to -1 (none), but since we use several custom standards, it will not let me select the right custom standard. Below is my actual callout.
Set swFeat = swModel.FeatureManager.InsertCosmeticThread3(-1, "Machine Threads", "#8-32", 0.0041656, swEndConditionBlind, 0.0062484, "")
This callout will insert the cosmetic thread on the preselected feature or features and that is great, but the thread standard and size don't end up correct since it selects the wrong thread standard and that thread standard doesn't have the size I asked for. Is there any way to specify the exact thread standard while adding a cosmetic thread and using custom thread standards?
Thanks in advance for the help.