Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to place Inventor Collection into ArrayList or Hashset

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
abdullah_elq
279 Views, 2 Replies

How to place Inventor Collection into ArrayList or Hashset

abdullah_elq
Advocate
Advocate

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)

 

0 Likes

How to place Inventor Collection into ArrayList or Hashset

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)

 

2 REPLIES 2
Message 2 of 3
JelteDeJong
in reply to: abdullah_elq

JelteDeJong
Mentor
Mentor
Accepted 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.

EESignature


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.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3
abdullah_elq
in reply to: abdullah_elq

abdullah_elq
Advocate
Advocate

@JelteDeJong thank you very much!

0 Likes

@JelteDeJong thank you very much!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report