SampleEditorGetString
Overview
This C# programming manual provides a practical demonstration of how to obtain and retrieve an string value from user input.
Sample code
For example:
Name | Value |
---|
var app = new Beaver.BcadApplication();
var doc = app.ActiveDocument;
if (doc == null)
doc = app.Documents.Add();
var stp = doc.STEPDocument;
Beaver.Editor editor = null; {
var app = new Beaver.BcadApplication();
var doc = app.ActiveDocument;
editor = doc.Editor;
}
Beaver.PromptStringResult result = null; {
var options = new Beaver.PromptStringOptions(); {
options.Message = "Input Name";
options.UseDefaultValue = true;
options.DefaultValue = "Beaver";
{
Beaver.Keyword keyword1 = new Beaver.Keyword(); {
keyword1.Key = "D";
keyword1.Description = "Description";
}
Beaver.Keyword keyword2 = new Beaver.Keyword(); {
keyword2.Key = "R";
keyword2.Description = "Role";
}
options.Keywords.Add(keyword1);
options.Keywords.Add(keyword2);
}
}
result = editor.GetString(options);
}
editor.WriteMessage("status: " + result.Status + " StringResult: " + result.StringResult + " value: " + result.Value);