creating imate with ilogic

creating imate with ilogic

Anonymous
Not applicable
2,472 Views
4 Replies
Message 1 of 5

creating imate with ilogic

Anonymous
Not applicable

I would like to create imates with ilogic. Can you do this?

0 Likes
Accepted solutions (1)
2,473 Views
4 Replies
Replies (4)
Message 2 of 5

t_hascj
Autodesk
Autodesk

Hi,

Yes it is possible. Look at some samples for iMate: Add iMate Definition API Sample and iMate Result Creation API Sample.

Thanks,
Jaroslav

0 Likes
Message 3 of 5

Curtis_Waguespack
Consultant
Consultant
Accepted solution

Hi tmayesPUD23,

 

The API sample posted previously creates a new part file and then creates some geometry from scratch. Most likely that is not what you're attempting to do, and so depending upon your level of knowledge with programming in Inventor, it might be difficult to adapt that example.

 

With that in mind, attached is a working example (Inventor 2017 file) based off of the API sample, that uses existing geometry and creates 2 imates, one on both ends. Also, below is the code in case it helps someone find this topic in a future search.

 

Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

' Create a new part document, using the default part template.
Dim oPartDoc As PartDocument
oPartDoc = ThisApplication.ActiveDocument

' a reference to the component definition.
Dim oCompDef As PartComponentDefinition
oCompDef = oPartDoc.ComponentDefinition

Dim oExtrude1 As ExtrudeFeature
oExtrude1 = oCompDef.Features.ExtrudeFeatures("Extrusion1")

' Create a mate iMateDefinition on a side face of the first extrude.
Dim oMateiMateDefinition As MateiMateDefinition
oMateiMateDefinition = oCompDef.iMateDefinitions.AddMateiMateDefinition( _
                    oExtrude1.StartFaces.Item(1), 0, , , "MateA")

' Create a match list of names to use for the next iMateDefinition.
Dim strMatchList(2) As String
strMatchList(0) = "InsertA"
strMatchList(1) = "InsertB"
strMatchList(2) = "InsertC"

' Create an insert iMateDefinition on the cylindrical face of the second extrude.
Dim oInsertiMateDefinition As InsertiMateDefinition
oInsertiMateDefinition = oCompDef.iMateDefinitions.AddInsertiMateDefinition( _
                    oExtrude1.EndFaces.Item(1), False, 0, , "InsertA", strMatchList)

EESignature

Message 4 of 5

Anonymous
Not applicable

Thanks Curtis

Message 5 of 5

josh.linares-stanley
Enthusiast
Enthusiast

Hi,

Is there a way to adapt this so the user is asked which face they wish to apply the imate to using  ThisApplication.CommandManager.PickFace("Select a face") please. 

0 Likes