Disable windows message boxes

Disable windows message boxes

Anonymous
Not applicable
2,274 Views
10 Replies
Message 1 of 11

Disable windows message boxes

Anonymous
Not applicable

I would like a way to temporarily disable any windows message boxes from appearing. Is there a setting in Inventor I can turn on/off manually or a piece of code I could include at the start of my iLogic rule?

0 Likes
2,275 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable

Hello @Anonymous

 

You can try to set the Inventor.Application property SilentOperation, like this:

ThisApplication.SilentOperation = True
' ... do your code stuff ...
ThisApplication.SilentOperation = False

But you should probably wrap your code in a Try ... Catch ... End Try block to be sure that you always executes the last line to reset the property.

 

This disables most of the dialog boxes from Inventor but not all!

 

For the other dialog boxes which you can't disable you could either find, or make yourself, a helper program that waits for specific dialog boxes and activates the button you want.

 

Regards,

Jens Bejer Pedersen

Developer, Symetri A/S

www.symetri.com

 

0 Likes
Message 3 of 11

Anonymous
Not applicable

hi @Anonymous

 

I thought this would have worked... but the message box shows

 

ThisApplication.SilentOperation = True

MsgBox("hi world")
     

 

0 Likes
Message 4 of 11

Anonymous
Not applicable

Hello @Anonymous

 

Yes your own dialog boxes are not stopped by this property, only the dialog boxes that Inventor might show.

 

If you want to have some kind of switch controlling your own code, then you will have to put that in your code.

 

I have sometimes used code like this:

Dim showMsg As Boolean = True
'Remove the comment from next line to disable message boxes
'showMsg = false

If showMsg Then MsgBox( ... )

Then i just need to change one line to disable all my own message boxes.

 

In an AddIn this would then be done by an application setting in an external settings file, or by using some logging framework, to enable changing this while the program is running.

 

Regards,

Jens Bejer Pedersen

Developer, Symetri A/S

www.symetri.com

0 Likes
Message 5 of 11

bradeneuropeArthur
Mentor
Mentor
Hi,

Or you could use also the inventor.silentoperation = true as follow.

If inventor.silentoperation = false Then
MsgBox "text message here"
End if

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 6 of 11

Anonymous
Not applicable

@bradeneuropeArthur @Anonymous

 

I should have mentioned, the rules with message boxes in them are in numerous sub parts which are all event triggered. I was hoping there would be a way to ignore them all from the top level assembly rule. Otherwise I'll need to go in and modify all the those rules to include a bit of logic like you both mentioned.

0 Likes
Message 7 of 11

Anonymous
Not applicable

Hello @Anonymous

 

The iLogic code is actually just .NET code that gets compiled to a temporary dll and loaded in Inventor, and there is no way to automatically suppress ordinary Windows message boxes (as far as I know), so yes you have to modify all your rules to get this functionality.

 

Regards,

Jens Bejer Pedersen

Developer, Symetri A/S

www.symetri.com

 

0 Likes
Message 8 of 11

bradeneuropeArthur
Mentor
Mentor

Hi,

 

General remark to this:

you should start programming your own add-ins to be flexible to this point.

Coding in the parts or assemblies is not that flexible as you can see now.

 

Actually it is not that difficult to program your own add ins if you familiar with I-logic!

Afterward you will see the benefits of add-ins.

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 9 of 11

Anonymous
Not applicable

I've tried this before but failed miserably. I had written a simple program to test in Visual Studio, which I created from the Autodesk Inventor AddIn template and was worked when stepping through it. But for some reason I couldn't get the final step complete. From what I remember it was when moving the dll file somewhere Inventor can find it so that it can load the add-in, I put in in the same folder as all the other dll's but still it wouldn't appear on the addin list.

 

I'm willing to give it another go if you have any advice? What benefits do you believe I'd gain?

0 Likes
Message 10 of 11

bradeneuropeArthur
Mentor
Mentor

Hi,

You have already given yourselves the answer I think to the point o build in code.

Using Add-ins and dll’s has the following advantages:

  • Reuseability of the coding
  • More flexible when changes are needed.
  • Is not build into files.
  • More flexible because the complete API is available.
  • More flexible and easier regarding file managment
  • Afterward you will see that it is easier
  • ……

Regarding the location of the add in files the following:

 

Hi,
You have already given yourselves the answer I think to the point o build in code.
Using Add-ins and dll’s has the following advantages:
•	Reuseability of the coding
•	More flexible when changes are needed.
•	Is not build into files.
•	More flexible because the complete API is available.
•	More flexible and easier regarding file managment
•	Afterward you will see that it is easier
•	……
Regarding the location of the add in files the following:

 

 

Hope this will change your mind.

 

I you need help I am willing to!

 

Regards,

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

0 Likes
Message 11 of 11

catot
Advocate
Advocate

@Anonymous

 

I have some advice from my own experience. I'm new to this, have never done any programming before, and are currently working on an Add-In using Visual Studio in VB .net as a side project on my spare time. 

 

I started out with the Add-In template as you did, adding Modules & Classes to contain the code for my application. I have found myself really appreciating all the good work put into the Inventor API Help. Without it, I probably would have given up a long time ago. There is a lot of useful information in the User Manual chapter to get you started. But I frequently use it to point me in the right direction to achieve what I plan to do.

 

 

Regarding the reason for why you abandoned your project in the past: If you add Inventor to the project in Visual Studio as the Debugging application, you can Debug directly in Visual Studio which automatically launches Inventor. Doing this automatically adds the files (.dll ++) to the correct location on your computer, so you are also able to launch Inventor separately (without Visual Studio) and use the Add-In as normal.

I believe this is stated in the previously mentioned chapter in the API Help, so that's what I've done, and it works like a charm.

 

For deployment to other computers, then you should refer to the API Help for where to unpack/copy the files. (see picture below).

 

 

image001.png

 

image004.jpg

 

 

I also highly recommend watching the following video by the API guru Brian Ekins, detailing VBA vs iLogic vs VB.NET and more:

http://au.autodesk.com/au-online/classes-on-demand/class-catalog/classes/year-2016/inventor-professional/sd17917#chapter=0

 

Hope that helps a little.

0 Likes