Message 1 of 2
iLogic - automatically generate iMates on place

Not applicable
09-02-2016
07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like the following bit of code to place the component using iMates.
SyntaxEditor Code Snippet
'file path to use oPath = ThisDoc.Path & "\Phantom\" 'file to use oFile = "Q02120-2.iam" MessageBox.Show("This example is looking for this file: " & vbLf & oPath & oFile, "iLogic") ' set a reference to the assembly component definintion. ' This assumes an assembly document is open. Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition ' Set a reference to the transient geometry object. Dim oTG As TransientGeometry oTG = ThisApplication.TransientGeometry ' Create a matrix. Dim oMatrix As Matrix oMatrix = oTG.CreateMatrix 'Iterate through all of the occurrences Dim oOccurrence As ComponentOccurrence 'place an instance of the component oOccurrence = oAsmCompDef.Occurrences.Add(oPath & oFile,oMatrix)
I came across this post which might have something in it, but I've been unable to extract what I need from it.
Any help would be much appreciated!