I have an ObjectCollection object that contains a bunch of transient geometry (mostly Cirle2d's and LineSegment2d's). I'm looping through it and performing operations on each object. There are some operations that are different depending on whether the object is a circle or a line. Is there a way to check which type of 2d geometry the object is? Most objects have a "Type" property, but these don't, which is very frustrating.
Solved! Go to Solution.
I have an ObjectCollection object that contains a bunch of transient geometry (mostly Cirle2d's and LineSegment2d's). I'm looping through it and performing operations on each object. There are some operations that are different depending on whether the object is a circle or a line. Is there a way to check which type of 2d geometry the object is? Most objects have a "Type" property, but these don't, which is very frustrating.
Solved! Go to Solution.
Solved by LukeDavenport. Go to Solution.
Hi Odeyoe,
I think you can do this (although I haven't tested it). Does that work?
Luke
For Each O In OBJ Dim testType As String = TypeName(O) Select Case testType Case "LineSegment2d" MsgBox("Line Segment") Case "Circle2d" MsgBox("Circle") End Select Next
Hi Odeyoe,
I think you can do this (although I haven't tested it). Does that work?
Luke
For Each O In OBJ Dim testType As String = TypeName(O) Select Case testType Case "LineSegment2d" MsgBox("Line Segment") Case "Circle2d" MsgBox("Circle") End Select Next
This appears to be working. Thank you!
This appears to be working. Thank you!
Can't find what you're looking for? Ask the community or share your knowledge.