Solved! Go to solution

Avoid displaying alerts when adding Occurrence

Hello there, simple question here.


When placing Occurrences inside an assembly, by means of the method AddByFilename, if some problem occurs (for example, cyclic dependencies), SE launches an error message, along with the exception stuff, which I can catch, get message for the user and so on...


The problem is that SE error message stops the whole process, while I would prefer to have it finish without any interaction from the user, which would get all the error messages collected at the end of the process.


I have tried turning to False Application.DisplayAlerts property, with no success, the message is always shown and the execution stopped.


Is there any way of placing Occurrences in an assembly without any error message dialog (just exception management) popping when some problem inhibits the placement?


Much thanks in advance!

Accepted by topic author javigoca
‎03-31-2017 04:16 AM

Re: Avoid displaying alerts when adding Occurrence

The Application.Interactive property is what you're looking for.


application.Interactive = false;

// Do work

application.Interactive = true;
Jason Newell
Applications Architect

Re: Avoid displaying alerts when adding Occurrence

[ Edited ]



SolidEdgeFramework.Application.DisplayAlerts = False
' Do work
SolidEdgeFramework.Application.DisplayAlerts = True


Greetings from Germany
Christian Kunkel

Re: Avoid displaying alerts when adding Occurrence



Conceptually I agree with you but most of us have experience situations where Solid Edge does not honor this setting and displays alerts anyway. As the OP mentioned, he had already tried setting DisplayAlerts = false. Ideally, we need to submit an IR with GTAC so that they can correct their code to honor DisplayAlerts.

Jason Newell
Applications Architect