Hi,
I have created a macro to create a hole in a part. However, themacro stops everytime a dimension is added to the hole as themodify dimension box appears.
I know that turning off "Input Dimension Value" system settingsolves this problem but I want to be able to turn off this featureonly when the macro is running.
So far I am trying:
Public Enum swUserPreferenceToggle_e
swInputDimValOnCreate = 1
End Enum
sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set swSelMgr = Part.SelectionManager
Set swModExt = Part.Extension
swApp.SetUserPreferenceToggle swInputDimValOnCreate, False
I get no error message but it does not change the system value.
I saw that Sldworks::SetUserPreferenceToggle is void in the API. Isthat the problem? I have a feeling it is that I don't understandhow to enumerate parameters.
Also, a general follow up question. How are the numbers picked whenenumerating lists of only one or two settings? In API example thereis sometimes only one item in the list but it might be set to 18,for example.
Thanks for any help.SolidworksApi macros
I have created a macro to create a hole in a part. However, themacro stops everytime a dimension is added to the hole as themodify dimension box appears.
I know that turning off "Input Dimension Value" system settingsolves this problem but I want to be able to turn off this featureonly when the macro is running.
So far I am trying:
Public Enum swUserPreferenceToggle_e
swInputDimValOnCreate = 1
End Enum
sub main()
Set swApp = Application.SldWorks
Set Part = swApp.ActiveDoc
Set swSelMgr = Part.SelectionManager
Set swModExt = Part.Extension
swApp.SetUserPreferenceToggle swInputDimValOnCreate, False
I get no error message but it does not change the system value.
I saw that Sldworks::SetUserPreferenceToggle is void in the API. Isthat the problem? I have a feeling it is that I don't understandhow to enumerate parameters.
Also, a general follow up question. How are the numbers picked whenenumerating lists of only one or two settings? In API example thereis sometimes only one item in the list but it might be set to 18,for example.
Thanks for any help.SolidworksApi macros
