BIM VILLAGE

Version 2.5.2

SampleEditorGetBool

Overview

This C# programming manual provides a practical demonstration of how to obtain and retrieve an bool 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.PromptBoolResult result = null; {
	var options = new Beaver.PromptBoolOptions(); {
		options.Message = "Input True or False";
		options.UseDefaultValue = true;
		options.DefaultValue = true;
		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.GetBool(options);
}
editor.WriteMessage("status: " + result.Status + " StringResult: " + result.StringResult + " value: " + result.Value);



			

© 2019 - 2022 BIM VILLAGE.