- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'd like to know the reason of Exception ("Unspecified error", HResult 0x80004005) on attempt to read the value of "DrivenBy" Property of one particular WorkPlane* with the below iLogic code:
For each oWPl in ThisDoc.Document.ComponentDefinition.WorkPlanes
logger.debug("oWPl.Name = " & oWPl.Name)
' If oWPl.DefinitionType.ToString <> "kTwoPlanesWorkPlane" Then Continue FOR
If System.Enum.GetName(GetType(WorkPlaneDefinitionEnum), oWPl.DefinitionType) <> "kTwoPlanesWorkPlane" Then Continue FOR
Dim oWPlDBs As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
try
oWPlDBs = oWPL.DrivenBy' 80004005 !!!!!!
catch ex As Exception
logger.debug(" ex.Data = " & ex.Data.ToString)
logger.debug(" ex.HResult = " & ex.HResult)
logger.debug(" ex.Message = " & ex.Message)
logger.debug(" ex.Source = " & ex.Source)
logger.debug(" ex.StackTrace = " & ex.StackTrace)
end try
logger.debug(" DrivenBy = " & oWPlDBs.Count)
Next
I also converted the code to VB.net in order to get some more details by means of VisualStudio debugger and got "Exception has been thrown by the target of an invocation" ... which has no much sense for me.
Sample IPT (Inventor 2022) is attached.
* The WorkPlane "Part2 WP" was created ByTwoPlanes (middle between Faces of the flat Body)
PS: This issue was found in context of project that is supposed to either find existing "middle plane" or create it (if there is no one yet).
Please vote for Inventor-Idea Text Search within Option Names
Solved! Go to Solution.