Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

2013: Automation Error

1 REPLY 1
Reply
Message 1 of 2
Allen_Hart
468 Views, 1 Reply

2013: Automation Error

Using Inventor VBA to test access to the company database by setting a reference to a custom dll,

 

Public mySO As SAFDrawingTools2.ShopOrderInfo

Public Sub TEST_SO()
    RetrieveShopOrder (CInt(23851))
End Sub

Private Sub RetrieveShopOrder(ByVal oOrder As Integer)

    Set mySO = New ShopOrderInfo 
' FOR SOME REASON, THIS DOES NOT GET SET. ' Watching the VBA ERR object during debug, it shows ' Err.Number as -2146233079 ' Err.Description as "Automation error" ' Err.HelpContext as 1000440 ' But the run does not halt with an error message. ' Execution continues happily on to the next line. mySO.Retrieve (oOrder)
' This throws the Object Not Set error ' because mySO is set to nothing. End Sub

 

This same custom dll worked great in Autocad VBA, and still does using dot net for Autocad.

Also works fine using Excel VBA.

Inventor not so much.

 

What is this error? 

I can't find any help for it. What is the trick to make this work in Inventor?

thanks

Allen

1 REPLY 1
Message 2 of 2
xiaodong_liang
in reply to: Allen_Hart

Hi, 

 

Without looking at the source code of SAFDrawingTools2, I do not think anybody here would have a comment on the question because the code snippet you provided does not tell any information how to address the issue. could you try to isolate SAFDrawingTools2 and provide a small, buildable, reproducible sample?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report