I'm trying to create a hole wizard feature using the following API call:
swModel.FeatureManager.HoleWizard4(swWzdGeneralHoleTypes_e.swWzdTap, -1, swWzdHoleStandardFastenerTypes_e.swStandardPCSReturnPins, "4H7", swEndConditions_e.swEndCondBlind, 0.0038, 0.0254, 0.008, 0, 0, 0, 0, 2.05948851735331, 0, 0, 0, 0, -1, -1, "", False, True, True, True, True, False)
This is SW2012, I realize that HoleWizard4 is deprecated in recent versions.
The "4H7" is part of our internal standard for H7 reamed holes. We represent reamed holes using threaded holes in the Toolbox Standard and select "Threads Removed" to show the correct diameter in the model. This function successfully inserts a 4H7 reamed hole.
The end goal is to have the user pre-select a hole wizard feature (on a component in an assembly) along with a Face on another component in the same assembly. When they run the macro, a hole feature will be created on the selected Face with compatible type. So a threaded hole would correspond with a clearance hole, vice versa.
The problem I am having is that the specified diameter (bold in the example) has to agree with the diameter specified in the Toolbox Standard for 4H7 holes. Otherwise the hole is inserted with a diameter override.
swModel.FeatureManager.HoleWizard4(swWzdGeneralHoleTypes_e.swWzdTap, -1, swWzdHoleStandardFastenerTypes_e.swStandardPCSReturnPins, "4H7", swEndConditions_e.swEndCondBlind, 0.01, 0.0254, 0.008, 0, 0, 0, 0, 2.05948851735331, 0, 0, 0, 0, -1, -1, "", False, True, True, True, True, False)
In fact, depending on the hole type, there are up to 13 parameters that must agree with the hole standard in order for the feature to be created properly. I don't know how to look those values up in the toolbox standard. I don't even know where the toolbox standards reside.
I've thought about building an independent table for storing those parameters, there really are only about 30 or so hole types/diameters that might be encountered. However, that doesn't seem very elegant - it seems like bad practice to point to two different databases for hole size information and a lot of extra work.
Is anyone familiar with reading from the Hole Wizard Standards? What is the typical approach when generating hole wizard features of a particular type?