Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
llorden4
in reply to: llorden4

Quite a bit more playing, the root of it all appears to be stemmed from some declarations...

 

Sub FlatPlanes
CreateFlatPlanes = False
Dim oDoc As Document = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition  'Error occurs here

At this point, I get this error after the file is saved..

 Error in rule: Plane Generator, in document: Plane Int Test.iam

Member not found. (Exception from HRESULT: 0x80020003 (DISP_E_MEMBERNOTFOUND))

 

Making this document declaration change...

Sub FlatPlanes
CreateFlatPlanes = False
Dim oDoc As AssemblyDocument = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition 'Error occurs here

 

Gives me this error instead...

Error in rule: Plane Generator, in document: Plane Int Test.iam

Object of type 'System.__ComObject' cannot be converted to type 'Inventor.ComponentOccurrence'.

 

For some reason, I am now getting errors when I try to declare a variable name for my assembly component definitions.

Autodesk Inventor Certified Professional