pyroclasm
Computer
- May 17, 2005
- 24
Hey Guys,
I need some help. I have a form with 3 Radio buttons.
Radio Buttions:
1. Document Properties
2. Configuration Properties
3. Both
And one CommandButton, "removeButton" all on a form. My aim is to be able to remove all properties from either Document Properties, Configuration Properties, or all Properties in Document. I am kinda new to programming and have tried looking through the Help Document, but can't figure this one out. Guys, please, can you help me figure this one out... what is wrong with my code?
Private Sub removeButton_Click()
Dim strConfiguration As String
Set swApp = Application.SldWorks
Set swModelDoc = swApp.ActiveDoc
strConfiguration = GetActiveConfiguration(swModelDoc)
If optDocPrp = True Then
' 'REMOVE DOC PROPERTIES LOOP
' Dim arDocPrpNames As Variant
'
' arDocPrpNames = swModelDoc.GetCustomInfoNames2("")
' MsgBox (arDocPrpNames(0))
'
' For i = 0 To arDocPrpNames.Length
' swModelDoc.DeleteCustomInfo2 "", arDocPrpNames(i)
' MsgBox i & " Document Properties Deleted"
' Next
ElseIf optConfigPrp = True Then
'REMOVE CONFIG PROPERTIES LOOP
Dim arConfigPrpNames As Variant
arConfigPrpNames = swModelDoc.GetCustomInfoNames2(strConfiguration)
MsgBox (arConfigPrpNames(0))
For i = 0 To arConfigPrpNames.Length
swModelDoc.DeleteCustomInfo2 "", arConfigPrpNames(i)
MsgBox i & " Configuration Properties Deleted"
Next
Else
'Remove Both Configuration and Document Properties
End If
End Sub
I need some help. I have a form with 3 Radio buttons.
Radio Buttions:
1. Document Properties
2. Configuration Properties
3. Both
And one CommandButton, "removeButton" all on a form. My aim is to be able to remove all properties from either Document Properties, Configuration Properties, or all Properties in Document. I am kinda new to programming and have tried looking through the Help Document, but can't figure this one out. Guys, please, can you help me figure this one out... what is wrong with my code?
Private Sub removeButton_Click()
Dim strConfiguration As String
Set swApp = Application.SldWorks
Set swModelDoc = swApp.ActiveDoc
strConfiguration = GetActiveConfiguration(swModelDoc)
If optDocPrp = True Then
' 'REMOVE DOC PROPERTIES LOOP
' Dim arDocPrpNames As Variant
'
' arDocPrpNames = swModelDoc.GetCustomInfoNames2("")
' MsgBox (arDocPrpNames(0))
'
' For i = 0 To arDocPrpNames.Length
' swModelDoc.DeleteCustomInfo2 "", arDocPrpNames(i)
' MsgBox i & " Document Properties Deleted"
' Next
ElseIf optConfigPrp = True Then
'REMOVE CONFIG PROPERTIES LOOP
Dim arConfigPrpNames As Variant
arConfigPrpNames = swModelDoc.GetCustomInfoNames2(strConfiguration)
MsgBox (arConfigPrpNames(0))
For i = 0 To arConfigPrpNames.Length
swModelDoc.DeleteCustomInfo2 "", arConfigPrpNames(i)
MsgBox i & " Configuration Properties Deleted"
Next
Else
'Remove Both Configuration and Document Properties
End If
End Sub