Inventor Customization

Inventor Customization

Reply
Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 1 of 19 (275 Views)

64 bit woes. Need help kicking off an Addin.

275 Views, 18 Replies
02-23-2012 03:30 PM

Hi,

 

We are using Inventor 2011. 

 

I recently switched all of our Inventor users over to 64 bit Windows 7.

 

They like the elbow room it provides but the VBA suite of 32 bit VBA programs have problems

Occasionally they crash with a 32 bit memroy error.  Or just lock up.

All 12 of these main tools work flawlessly on a 32 bit windows 7 PC.

 

I've been rewriting them as dlls that I lauch with iLogc as an interm process unfortulately I'm told that iLogic also runs as a 32 bit process.

 

Because of this I am looking into rewriting the entire suite as addins.

I am assuming running the applets in the 64 bit memory space will solve some or all  of the issues we are experiencing..

 

My problems is I  Find writing for the ribbon unintuitive, confusing and a royal pain. Still haven't made a successfull addin of this type.

 

Can one write each addin as a separate tool with embedded icons such that after loading they are available in the customize tool | commmands tab?  Perhaps under Addins?  At that point they could be added to whatever tool inside inventor manually.

 

Are there any samples or examples of how to write an addin like this?

 

Thank You,

 

Tom

Mentor
AlexF1980
Posts: 309
Registered: ‎07-05-2005
Message 2 of 19 (257 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-24-2012 05:04 AM in reply to: Gruff

A good place to start would be by downloading the Autodesk Labs Screenshot Plugin of the month from here:

 

http://labs.autodesk.com/utilities/inventor_screenshot/

 

It comes complete with the source code and will work on Inventor versions 2008 thru' 2012.

 

Within the source it defines at least one button within the RibbonBar as well as a Visual Studio Installer Project for installation purposes.

 

:-)

Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 3 of 19 (248 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-24-2012 01:17 PM in reply to: Gruff

What is an inventor Screen Shot, What will it do to my system, and what will it do for me?

 

I Really hate to download someting when I do not know what it is.

 

I've looked at Add_in samples that supposedly add things to the riboon.  As I said I can make no sense of it.

 

This is why I am looking for a simpler way.

Distinguished Contributor
nmunro
Posts: 144
Registered: ‎10-20-2001
Message 4 of 19 (243 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-24-2012 02:55 PM in reply to: Gruff

Unfortunately you're going to have to wade in and figure out how to do it the way the Inventor API enables you to do it. As a very basic outline you have to create a button definition (think of it as creating a button) when your add-in loads. The button definition describes the type of button, possibly images associated with the large and small versions of the button. Most importantly, you have to write some code that gets linked to the event that happens when a user clicks on your button.

 

You must then add that button to a panel on one or more ribbons. Each environment (part, assembly, sketch, etc)  in Inventor has its own set of ribbon tabs and associated panels. You can add your button to one or more of these depending on what you want to act on when the button is clicked. In addition you can define your own tab(s) and / or panel9s) and add these to the UI and place your button there.

 

It does take some commitment to become familiar with the workflow, but once you get it, it's not so bad. There are plenty of resources to help you out and provide good examples. The My First Plug In post at the top of this forum is a great place to start.

 

As usual, no free lunches :smileywink:

 

Neil

 

Mentor
AlexF1980
Posts: 309
Registered: ‎07-05-2005
Message 5 of 19 (229 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-27-2012 05:29 AM in reply to: Gruff

Hi Gruff,

 

The Inventor Screenshot tool was written in response to a comment I raised on the Through-the-Interface blog; It simply allows the user to take a screenshot and save the resultant image to a location of their choosing on the system somewhere.

 

As Neil said, it takes a bit of reading to get to grips with, but if you wrote the original vba you should have little or no problems switching it over.

 

The "My First Plugin" post is a great place to start.

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 6 of 19 (216 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-28-2012 08:02 PM in reply to: Gruff

Note: iLogic is an add-in and it runs in the Inventor process.  On a 64-bit system, iLogic is 64-bit.



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Valued Contributor
andrewwhiteinc
Posts: 59
Registered: ‎02-02-2011
Message 7 of 19 (203 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-29-2012 10:38 AM in reply to: Gruff

I ran into the same problem with crashing when we started using 64bit windows. I found that certian commands in the program need to be delayed in order for the previous command to complete (preventing the crashes). In VBA it had its own module for delays that I found on google, VB.NET call system.threading.thread.sleep(<milisecondsOfWaitTime>)

P. Andrew White,EIT
Engineer-in-Training, Industrial Automation
Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 8 of 19 (201 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-29-2012 10:47 AM in reply to: Gruff

MjDeck,

 

Are you talking vertion 2011 or 2012?

I swear you told me in another post that iLogic was 32 bit when launched from VBA.

 

Are you suggesting I write an addin that has an interface to run external 64 bit iLogic dlls from the Addin?

 

Getting confused here.

 

Employee
MjDeck
Posts: 959
Registered: ‎02-24-2009
Message 9 of 19 (196 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-29-2012 11:30 AM in reply to: Gruff

When an iLogic rule is run from VBA on a 64-bit system, it will run on a separate thread.  It's still in the 64-bit Inventor process, but it's on a separate thread: not the main thread.  Some things don't work the same on the separate thread.

 So the changed behavior is related to the fact that VBA is running in a separate 32-bit process, but technically everything in Inventor is running in 64-bit.

 If running iLogic rules is the best way to do what you're trying to do, then they should run better if you run them from an add-in, as compared to VBA.  But it might be easier to do everything you want within your add-in, without using iLogic.



Mike Deck
Software Developer
DLS - Mechanical Design
Autodesk, Inc.

Valued Mentor
Gruff
Posts: 431
Registered: ‎11-24-2003
Message 10 of 19 (192 Views)

Re: 64 bit woes. Need help kicking off an Addin.

02-29-2012 12:09 PM in reply to: MjDeck

Okay.  I guess the problem with writing them as addins or combining them into one addin is develpment is slow.  My users are use to the quick turn around time afforded by developing and debugging in the field in VBA.

 

I was hoping to modularize each applet in my suite of tools such that I could recompile and disttribute the applets piecemeal. or for that matter add new applets to the suite without having to rewrite my Addin.

 

The bottom line though is that I want to eliminate all of my 64 bit issues in my custom apps so I will do whatever it takes to get there.

 

---

 

On another note.  What is the logic behind al these GUIDs in the StandardAddInServer.vb file?

 

Looking at the source for the ScreenShot Addin...

Is the Class Attribute that contains a GUID a fixed value like other Inventor API GUIDs or do I need to draw a new GUID for each Addin Class?  Does the m_ClientId GUID always match the Class GUID?

 

Further Down in the COM Registration section. do I need to draw a new GUID for the the Register and UnRegister Sub Routines for each addin or is that a fixed value?

 

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.