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 get iMateDefinition.ReferencedEntity

1 REPLY 1
Reply
Message 1 of 2
Anonymous
483 Views, 1 Reply

How to get iMateDefinition.ReferencedEntity

I have a part with a iMate in it called Part1.ipt
This part is inserted in a assembly called assy1.iam
assy1 is inserted in another assambly called assy2.iam.
I work with INV 2011 and VB6

I now want to get the entity where the iMate is based on from out of Assy2
I tried this with no result:

'oAsmCompDef = Assy2
'oOcc = Assy1
'oOccInsert = Part1

Dim oAsmCompDef As AssemblyComponentDefinition
Set oAsmCompDef = objInventorApp.ActiveDocument.ComponentDefinition
Dim oOcc As ComponentOccurrence
Set oOcc = oAsmCompDef.Occurrences.item(1)
Dim oOccInsert As ComponentOccurrence
Set oOccInsert = oOcc.SubOccurrences.Item(1)
'Get proper iMate
For i = 1 To oOccInsert.iMateDefinitions.Count
If oOccInsert.iMateDefinitions.Item(i).Name = "Insert In1" Then
Dim oiMate As Inventor.iMateDefinition
Set oiMate = oOccInsert.iMateDefinitions.Item(i) 'iMate is found
Exit For
End If
Next i
Dim oInsertEdge As iMateDefinition 'Edge
Set oInsertEdge = oiMate.ReferencedEntity -> this gives Nothing

Any clue?

Regards,

Geert

Edited by: GVDB on May 31, 2010 3:00 PM Edited by: GVDB on May 31, 2010 3:01 PM
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Hi Geert,

 

You can accces the refereced entity were the iMate was placed whit this code:

 

Dim oInsertEdge as Edge

Set oInsertEdge = oiMate.Entity

 

 

Regards,

 

Daniela Dubois

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

Post to forums  

Autodesk Design & Make Report