

Dim oiMateDef2 As iMateDefinition Dim bFoundDefinition As Boolean For Each oiMateDef2 In oOcc2. This loop demonstrates using the ' For Each method of iterating through a collection. Name)Įxit Sub End If ' Look through the iMateDefinitions defined for the second occurrence ' and find the one named "iMate:2". Item( i)Įxit For End If Next If oiMateDef1 Is Nothing Then MsgBox ( "An iMate definition named ""iMate:1"" does not exist in " & oOcc1. Name = "iMate:1" Then oiMateDef1 = oOcc1. 'Axis constraint Dim i As Long Dim oiMateDef1 As iMateDefinition For i = 1 To oOcc1. This loop demonstrates using the ' Count and Item properties of the iMateDefinitions object. ' Look through the iMateDefinitions defined for the first occurrence ' and find the one named "iMate:1". Add( "C:\Vault Workspace\Designs\_Part Library\MSC - Miscellaneous\", oMatrix) Cell(1, 4) = 10ĭim oOcc2 As ComponentOccurrence oOcc2 = oAsmCompDef. ' Place the second occurrence, but adjust the matrix slightly so they're ' not right on top of each other. Dim oOcc1 As ComponentOccurrence oOcc1 = oAsmCompDef. CreateMatrix ' Place the first occurrence. Dim oMatrix As Matrix oMatrix = ThisApplication. It will be initialized to an identity matrix. ComponentDefinition ' Create a new matrix object. Dim oAsmCompDef As Assembl圜omponentDefinition oAsmCompDef = ThisApplication. ' This will fail if an assembly document is not open. ' Get the component definition of the currently open assembly.
#Imate i mate code#
Synta圎ditor Code Snippet Public Sub Main() How can i avoid the error in the limit imates? After i open them once everything works fine. After the program runs I have to open the two mates with the limits for the limits to register. They work if you connect them manually, however with the program the mate gets created but the limit does not work properly. My issue lies with limits placed in some of the iMates. I insert 2 of the parts into an assembly using ilogic and create various mates with the iMates within the macro.
