BIM VILLAGE

Version 2.5.2

SampleEditorGetDouble

Overview

This C# programming manual provides a practical demonstration of how to obtain and retrieve an double 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.PromptDoubleResult result = null; {
	var options = new Beaver.PromptDoubleOptions(); {
		options.Message = "Input Width";
		options.UseDefaultValue = true;
		options.DefaultValue = 77.7;
		{
			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);
		}
		options.UpperLimit = 100.0;
		options.LowerLimit = -100.0;
	}
	result = editor.GetDouble(options);
}
editor.WriteMessage("status: " + result.Status + " StringResult: " + result.StringResult + " value: " + result.Value);
			

© 2019 - 2022 BIM VILLAGE.