Hi,
Is there any way to place all the items in an Inventor Collection into ArrayList or HashSet?
For Example:
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition Dim oSB As SurfaceBody = oCompDef.SurfaceBodies(1) Dim oFaces As Faces = oSB.Faces 'Is there any way to place all the items in oFaces into FaceArrayList or FaceHashSet without a loop? Dim FaceArrayList As New ArrayList 'FaceArrayList = oFaces Dim FaceHashSet As New HashSet(Of Object) 'FaceHashSet.UnionWith(oFaces)
Solved! Go to Solution.
Hi,
Is there any way to place all the items in an Inventor Collection into ArrayList or HashSet?
For Example:
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition Dim oSB As SurfaceBody = oCompDef.SurfaceBodies(1) Dim oFaces As Faces = oSB.Faces 'Is there any way to place all the items in oFaces into FaceArrayList or FaceHashSet without a loop? Dim FaceArrayList As New ArrayList 'FaceArrayList = oFaces Dim FaceHashSet As New HashSet(Of Object) 'FaceHashSet.UnionWith(oFaces)
Solved! Go to Solution.
Solved by JelteDeJong. Go to Solution.
try one of the following:
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oSB As SurfaceBody = oCompDef.SurfaceBodies(1)
Dim oFaces As Faces = oSB.Faces
Dim facesList = oFaces.Cast(Of Face).ToList()
Dim facesHashSet = oFaces.Cast(Of Face).ToHashSet()
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
try one of the following:
Dim oPartDoc As PartDocument = ThisApplication.ActiveDocument
Dim oCompDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oSB As SurfaceBody = oCompDef.SurfaceBodies(1)
Dim oFaces As Faces = oSB.Faces
Dim facesList = oFaces.Cast(Of Face).ToList()
Dim facesHashSet = oFaces.Cast(Of Face).ToHashSet()
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
@JelteDeJong thank you very much!
@JelteDeJong thank you very much!
Can't find what you're looking for? Ask the community or share your knowledge.