BIM VILLAGE

Version 2.5.2

SampleEditorGetPoint3d

Overview

This C# programming manual provides a practical demonstration of how to obtain and retrieve an three-dementional coords values 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.PromptPoint3dResult result = null; {
	var options = new Beaver.PromptPoint3dOptions(); {
		options.Message = "Input Width";
		{
			options.UseDefaultValue = true;
			var pt = new Beaver.GePoint3d();
			pt.x = 1000.0;
			pt.y = 2000.0;
			pt.z = 3000.0;
			options.DefaultValue = pt;
		}
		{
			options.UseBasePoint = true;
			var pt = new Beaver.GePoint3d();
			pt.x = 10.0;
			pt.y = 20.0;
			pt.z = 30.0;
			options.BasePoint = pt;
		}
		{
			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.GetPoint3d(options);
}
editor.WriteMessage("status: " + result.Status + " StringResult: " + result.StringResult + " value: x=" + result.Value.x + ", y=" + result.Value.y + ", z=" + result.Value.z);
			

© 2019 - 2022 BIM VILLAGE.