iLogic for idw from iam

iLogic for idw from iam

dan_inv09
Advisor Advisor
548 Views
3 Replies
Message 1 of 4

iLogic for idw from iam

dan_inv09
Advisor
Advisor

It seems when it gets to this line:

 

oBaseView = oSheet.DrawingViews.AddBaseView(oAsmCompDef,oPoint,2,kFrontViewOrientation,kHiddenLineRemovedDrawingViewStyle,,,oBaseViewOptions)

 

it gives this error:

 

Error in rule: Rule0, in document: DUMMY WELDMENT.iam

Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor._Document'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{70109AA1-63C1-11D2-B78B-0060B0EC020B}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).

 

 

Now, let's start off by stating that I have absolutely no idea what I'm doing. I'm just grabbing bits and pieces from other peoples code and trying to reconcile the variables. If someone could just point me in the direction of some sort of syntax so I can figure out what is supposed to be in that statement, that would be great, but I look at it and it all seems like gobbledigook and maybe the error is saying that it is.

 

I'll attach the whole code if anyone wants to point and laugh. (But if you had some constructive criticism that'd be okay too.)

0 Likes
549 Views
3 Replies
Replies (3)
Message 2 of 4

ADSKDJW4
Alumni
Alumni

@dan_inv09,

 

I will be moving this message to the Inventor Customization Forum as its better suited there for assistance.

 

Best Regards,

 

Don

0 Likes
Message 3 of 4

dan_inv09
Advisor
Advisor

Don,

 

Sorry I didn't catch you in time. I should have replied or edited this post when I decided to also try here.

 

 

This is the one that started here:

http://forums.autodesk.com/t5/inventor-customization/ilogic-for-idw-from-iam/m-p/6321501#U6321501

0 Likes
Message 4 of 4

JamieVJohnson2
Collaborator
Collaborator

maybe a little late, but the problem is the object your feeding as the "document" is actually an Assembly Component Definition, which is a property of the document, not the document itself.  AssemblyComponentDefinition, is effectively the list of components you see in the browser.  Use oAsmDoc instead of oAsmCompDef.

Jamie Johnson : Owner / Sisu Lissom, LLC https://sisulissom.com/
0 Likes