AnsweredAssumed Answered

Hole Wizard API changing the Standard drop down and the Hole Spec Size?

Question asked by Conner Davis on Jan 9, 2019
Latest reply on Jan 11, 2019 by Conner Davis

I attached a photo below to show the two combo-boxes I am attempting to change with the solidworks api. I have the hole wizard feature in an object as shown in the code below, but how could I change the Standard to ANSI Inch and how could I for instance change the M5x0.8 to M4x 0.7? Any help would be great, and thank you!

 

 

 

Dim swApp As SldWorks.SldWorks

Dim swModel As SldWorks.ModelDoc2

Dim swFeatMgr As SldWorks.FeatureManager

Dim swSelMgr As SldWorks.SelectionMgr

Dim swFeat As SldWorks.Feature

Dim swSelectionManager As SldWorks.SelectionMgr

Dim swDim As SldWorks.Dimension

Dim swWzdHole As WizardHoleFeatureData2

Dim filename As String

 

 

 

 

sub main()

 

 

Set swApp = Application.SldWorks

'UserForm1.Show

 

 

 

fileName = "C:\Engineering\Admin_Macros\NUT-MASTER.SLDPRT"

Set swModel = swApp.OpenDoc6(fileName, swDocumentTypes_e.swDocPART, swOpenDocOptions_Silent, "", errors, warnings)

Set swFeatMgr = swModel.FeatureManager

Set swSelMgr = swModel.SelectionManager

Set swFeat = swModel.FeatureByName("Hole")

Set swWzdHole = swFeat.GetDefinition

 

""""""""""""""""

Manipulate Hole Wizard Here

"""""""""""""""""""""""

 

 

 

 

End Sub

Outcomes