Occurrences.Add does not work?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
i am getting this issue when running this code on other people inventor but it works on mine
i was wondering if it is the location of the files with in the C:/ drive so i put the files on a shared drive and it is still the same.
it crashes out because it does not place any parts.
Background i am passing in Builder_Options As ArrayList and SystemArea As String
can anyone help me with this i cant get my head round why it works on my pc but not others ?
Kind Regards
CODE_____________________
'start new inventor assembly
Dim ThisApplication As Inventor.Application
ThisApplication = System.Runtime.InteropServices.Marshal.GetActiveObject("Inventor.Application")
ThisApplication.SilentOperation = True
Dim StartDoc As AssemblyDocument
StartDoc = ThisApplication.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject)
'StartDoc = ThisApplication.ActiveDocument
Dim oAsmCompDef As AssemblyComponentDefinition
'oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
oAsmCompDef = StartDoc.ComponentDefinition
'Create a new matrix object. It will be initialized to an identity matrix.
Dim oMatrix As Matrix
oMatrix = ThisApplication.TransientGeometry.CreateMatrix
' add all options to assembly
Dim SectionSelection As String
For Each SectionSelection In Builder_Options
oAsmCompDef.Occurrences.Add("C:\VaultWorkspace\Vault\" & SystemArea & "\" & SectionSelection & ".iam", oMatrix)
Next