Message 1 of 9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I wrote a code for read iproperties from part or assembly in folder. The code run:
1 - read all file in folder
2 - filter file in folder (.asm, .ipt)
3 - add component to assembly
4 - read iproperties
5 - delete component
All works very weel but the last phase give me the error:
I create many logger for control the code anche the code raw that give me a problem is:
Sub DeleteComponent()
Dim oAsmCompDef As AssemblyComponentDefinition = ThisApplication.ActiveDocument.ComponentDefinition
Dim oOcc As ComponentOccurrence
For Each oOcc In oAsmCompDef.Occurrences
If oOcc.DefinitionDocumentType = kAssemblyDocumentObject Then
Logger.Info("⃝⃝⃝⃝ [ Rimozione assieme " & oOcc.Name & " ]")
oOcc.Delete()
Logger.Info("⃝⃝⃝⃝ [ Fine rimozione dell'elemento " & oOcc.Name & " ]")
End If
Next
End Sub
oOcc.Delete()
I've already use this function in other code but now I've this problem.
How can i Solve it?
In attached the complete code.
Thanks
Solved! Go to Solution.