Reply
Solved! Go to solution

How to identify object type while looping through items in a selectset?

Hi,

 

I am pretty new to SolidEdge Automation & the use of its vast API. I just wanted to know how to identify if all items returned by the ActiveSelectSet are suppose HoleTables. I have deciphered from some of the samples at Codeplex how I can loop through each item one by one but cant figure out how to determine the type of each item.

 

Thanks,

Govind

1 REPLY
Solution
Solution
Accepted by topic author Govind
‎08-26-2015 04:32 AM

Re: How to identify object type while looping through items in a selectset?

[ Edited ]

For i As Integer = 1 To oSel.Count
  If TypeOf (oSel.Item(i)) Is SolidEdgeDraft.HoleTable Then
    oHT = oSel.Item(i)
    MessageBox.Show(oHT.Holes.Count.ToString())
  End If
Next

 

where the following are declared earlier:

Dim oSel As SolidEdgeFramework.SelectSet
Dim oHT As SolidEdgeDraft.HoleTable

 

For more language options see this:

http://surfandcode.blogspot.in/