Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I rather like to get the No button activated instead of the Yes button: to avoid affecting data in case press ENTER button accidentally.
Could I get help.
Sub main() oLFN_wExt_ModelDoc = IO.Path.GetFileName(ThisDrawing.ModelDocument.FullFileName) Dim oAbsoluteModel As Document oAbsoluteModel = ThisDoc.ModelDocument oFFN_ThisDoc = oAbsoluteModel.FullFileName oExtn_ModelDoc = Right(oFFN_ThisDoc, 4) oCustomPropertySet_Model = oAbsoluteModel.PropertySets.Item("Inventor User Defined Properties") ' Dim oDelete_Cust_iProps As New ArrayList ' oDelete_Cust_iProps.Add("Delete - Yes") ' oDelete_Cust_iProps.Add("Delete - No") ' oDelete_YN = InputListBox("Prompt", oDelete_Cust_iProps, oDelete_Cust_iProps(0), Title := "Title", ListName := "List") Dim nCutOff As Integer = 3 For Each oCust_iProperty In oCustomPropertySet_Model Try If oCust_iProperty.Name.Contains("REFD") Then 'And oCust_iProperty.Name.Contains("QTY") Then oDelete_YN = MessageBox.Show("oCust_iProperty.Name: " & oCust_iProperty.Name _ & vbLf & "oCust_iProperty.Value: " & oCust_iProperty.Value, "DELETE(YES)/EDIT(NO)" _ & vbLf & "YES - Delete" _ & vbLf & "No - Edit", MessageBoxButtons.YesNo) ' oDelete_Cust_iProps.Add() If oDelete_YN = vbYes Then oCust_iProperty.Value = "" ' oCust_iProperty.Delete Else If oDelete_YN = vbNo Then oCust_iProperty.Value = InputBox("Edit: ", "EDIT VALUE", oCust_iProperty.Value) End If If oCust_iProperty.NAME.Contains("REFD03") Then MessageBox.Show("oCust_iProperty.NAME: " & oCust_iProperty.NAME, "Title") End If ' oProp = oCustomPropertySet.Item(oCust_iProperty) ' oCustomPropertySet.Item(oCust_iProperty).Delete 'oCustProp.Delete End If Catch 'Do nothing End Try Next oCust_iProperty End Sub
Solved! Go to Solution.