Message 1 of 5
Code fails on second run
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
This line of code is giving me error on second run. The first run, the line works fine. However, when i run again, it will give an error. And when i open the target file, and I click on the UserParameter without doing anything and close the file. Then i run again, it will work again.
Please help.
Line 8:
oCompDoc.ComponentDefinition.Parameters.UserParameters.Item("Shell_ID").Value = oShellID
Error:
Error on line 8 in rule: Manifold Support, in document: TPAS004-R0-AS-01.iam
Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))
Sub Main() Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oOcc As ComponentOccurrence = oDoc.ComponentDefinition.Occurrences.ItemByName("Manifold Support") Dim oCompDoc As Document = oOcc.Definition.Document Dim oShellID As Decimal = Parameter("Shell_ID1") / 10 oCompDoc.ComponentDefinition.Parameters.UserParameters.Item("Shell_ID").Value = oShellID Parameter("MS_EL") = Parameter("N1_EL") Parameter("MS_Or") = Parameter("N1_Or") + 180 Parameter("mMS_Or") = -Parameter("MS_Or") Parameter("mMS_EL") = Parameter("MS_EL") Call UpdateModel(oDoc, oOcc) End Sub