.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Transient Text Detection

1 REPLY 1
SOLVED
Reply
Message 1 of 2
insmuratturna
497 Views, 1 Reply

Transient Text Detection

My project include Transient Text. If user  terminate the program then I couldn' t  erase Transient Text. Therefore at begining the program , I want to erase them.

 

Is it possible  to detect previous Transient Text.

 

Tags (2)
1 REPLY 1
Message 2 of 2
norman.yuan
in reply to: insmuratturna

I assume by saying "... if user terminate the program...", you do not mean user kills AutoCAD from Task Manager, or turn off the power to the computer. Rather, if it in your code where you provide user option to exit earlier from the code execution if needed, while at the point of exit, the said Transient graphics has already drawn.

 

It is your code's responsibility to clean up the mess before the code execution is ended, earlier, or to its full completion. The simplest way is to use try...finally... block to guarantee the code in finally... clause being executed. Something like:

 

// Do something

...

...

try

{

    //Show Transient graphics

    if (AskUserInput())

    {

        //Do whatever

    }

    else

    {

        //Since user cancels inputting, you can let user exit the process here

        return;

    }

}

finally

{

    // Erase the transient graphics here

}

 

// You may continue to do more work here

... ...

Norman Yuan

Drive CAD With Code

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report