Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to make a custom picked list of surface bodies to export and derive as individual components. I can get it to work for all surface bodies but want to make something where the user can pick the individual surface bodies and only export them. I get an error of object reference not set to instance of an object at the Got Here message. Any help would be greatly appreciated.
Dim CustomPartCollection As ObjectCollection Dim PickParts As Integer PickParts = MessageBox.Show("Do you want to pick individual parts", "Pick Parts", MessageBoxButtons.YesNo, MessageBoxIcon.Question) Dim sb1 As Object Dim c As Integer c=0 If PickParts = vbYes Then Dim Cancel As Boolean Cancel = False Do While Cancel = False Question = MessageBox.Show("Do you wish to pick another Solid Body?", "Pick Parts", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) If Question = vbYes Then sb1 = ThisApplication.CommandManager.Pick(kPartBodyFilter, "Pick Solid Body to Export") 'MsgBox("Got Here") Call CustomPartCollection.Add(sb1) c = c + 1 Else Cancel = True End If Loop
Solved! Go to Solution.