Avoid displaying alerts when adding Occurrence

Builder
Builder

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!

3 REPLIES

Re: Avoid displaying alerts when adding Occurrence

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

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

 

application.Interactive = false;

// Do work

application.Interactive = true;
Jason Newell
Applications Architect
www.jasonnewell.net

Re: Avoid displaying alerts when adding Occurrence

Legend
Legend

Or

 

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

 

Greetings from Germany
Christian Kunkel
https://c-k-m.info

Re: Avoid displaying alerts when adding Occurrence

Solution Partner Phenom Solution Partner Phenom
Solution Partner Phenom

Christian,

 

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
www.jasonnewell.net