VB Inventor References

VB Inventor References

Anonymous
Not applicable
316 Views
3 Replies
Message 1 of 4

VB Inventor References

Anonymous
Not applicable
Hello,

I am developing an application in VB and find that my references to Inventor Objects are unreliable. In particular oCompDef. I am finding that my compiled code runs fine on my PC but fails to obtain a reference to the active document's component definition on another identical PC!

What strategy would be considered 'best practice' for obtaining the following references in all of my Inventor methods:

oInvApp
oInvAssyDoc
oInvAssyCompDef
oInvAssyCompOccs

Should I declare and set a reference for each object needed in each of my methods or can I declare object variables at the top of my Class and only set these variables when they are Nothing.

Thank you
0 Likes
317 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
I've not heard of references being unreliable. In my experience, either the
reference was released from your side, or the object within Inventor that
the reference is to is no longer available. If this was a general problem
the API would be unusable. Can you put together a simple test case that can
reproduce the problem?
--
Brian Ekins
Autodesk Inventor API
0 Likes
Message 3 of 4

Anonymous
Not applicable
Hello Brian,

I had created a method which created a reference to the active document and then the component definition. My code was very thorough with good exception handling and I checked to ensure the references were not Nothing after they had been set.

I ran the compiled code (...bin\Release) which was fine on my PC. I copied it to an identical HP laptop and an exception error was caused when setting a reference to oInvAssyCompDef. After a considerable effort, unsuccessfully, to fix the error I posted my message to this Forum.

I thought it may not be my code so from Control Panel > Add or Remove Program > Inventor I repaired the application. This did not fix the error. I then un-installed Inventor and re-installed Inventor and the error disappeared! How odd.

Has anyone else experienced this?

Thank you.
0 Likes
Message 4 of 4

Anonymous
Not applicable
You say a reinstallation of inventor fixed this??? We have two of our 5 new vista machines that are throwing very interesting exceptions.

On one machine I am getting a VB error that the script cannot find the first view of a drawing even though the first view is plainly there.

On another machine running the same code return a NumLock cycle in addition to functioning properly, the fix for this was to cope the code from the network location to the local users desktop, go figure. Same code works fine on all other machines.

Eric

SysSpecs
IV 2008Pro SP1 - PS2008 (Admin) - WinVistaBusiness64 - Xeon 4core 1.86GHz64
8GBRAM - NVIDIA Quadro FX 4600 (driver 7.15.11.6002 - 4/26/2007) 768MB
0 Likes