BIM VILLAGE

Version 2.5.2

SampleEditorGetKeyword

Overview

This C# programming manual provides a practical demonstration of how to obtain and retrieve an keyword 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.PromptKeywordResult result = null; {
	var options = new Beaver.PromptKeywordOptions(); {
		options.Message = "Input Width";
		options.UseDefaultValue = true;
		options.DefaultValue = "H";
		{
			Beaver.Keyword keyword1 = new Beaver.Keyword(); {
				keyword1.Key = "H";
				keyword1.Description = "Height";
			}
			Beaver.Keyword keyword2 = new Beaver.Keyword(); {
				keyword2.Key = "D";
				keyword2.Description = "Depth";
			}
			options.Keywords.Add(keyword1);
			options.Keywords.Add(keyword2);
		}
	}
	result = editor.GetKeyword(options);
}
editor.WriteMessage("status: " + result.Status + " StringResult: " + result.StringResult + " value: " + result.Value);
			

© 2019 - 2022 BIM VILLAGE.