Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Accessing Application Object

Accessing Documents and ActiveDocument

From application object one can access document manager, Document Manager has peroperties and Methods by which one can access active document and also can add new document or open existing drawings.

Image Added 


Promping for User input 

For user IO Editor class is responsible, one can get it from Document and all related class for UserIO are available in Teigha.EditorInput namespace.


Code Block
languagec#
linenumberstrue
collapsetrue
            Document activeDocument = docManager.MdiActiveDocument;
            Editor ed = activeDocument.Editor;

            PromptIntegerOptions op = new PromptIntegerOptions("Input a positive integer");
            op.AllowNegative = false;
            PromptIntegerResult res =(PromptIntegerResult) ed.DoPrompt(op);
            if( res.Status == PromptStatus.OK)
            {
                int retVal = res.Value;
            }