- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this code in an Occurrence_Rule that I have that updates the occurrence names of all parts in the assembly and it works perfectly in the assembly. This is just part of the code and if I comment this part out, I do not get the error in the master assembly:
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oAsmCompDef.Occurrences
Dim oName As String
oName = oOccurrence.Name
oName2 = Left(oName, 1)
oName3 = Left(oName, 3)
oName4 = Mid(oName, 4)
If oName2 = "-" Then
oOccurrence.Name = FilePrefix & oName
Else If oName3 <> FilePrefix Then
oOccurrence.Name = FilePrefix & oName4
End IfNext
The scenario is that this code belongs to a single assembly that then gets put into a master assembly. While the single assembly is open, it functions as I need it to, updating the occurrence names. Once it is placed into a master assembly, it brings up the following error:
Error in rule: OccurrenceName_Rule, in document: 404-Unit_Assembly.iam
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
It is not corrupting the assembly or causing it to function improperly. It is just annoying because it does it for every subassembly containing that rule, which could be anywhere from 2 to 500+ of them.
** If my reply resolves this issue, please choose Accept Solution **
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
Scott Hallmark, Design Specialist | Fluor Corporation
Inventor and AutoCAD Certified Professional, Autodesk Certified Instructor | My Plant3D Notes | AU Speaker | ROLL TIDE!
Solved! Go to Solution.