...
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.
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 | ||||||
---|---|---|---|---|---|---|
| ||||||
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;
} |