概述
/// <summary>
/// 测量Face的面积和周长
/// </summary>
/// <param name="face">被测量面</param>
/// <param name="area">面积</param>
/// <param name="perimeter">周长</param>
public void AskFaceArea(Face face, out double area, out double perimeter)
{
try
{
Unit unit1 = (Unit)workPart.UnitCollection.FindObject("SquareMilliMeter");
Unit unit2 = (Unit)workPart.UnitCollection.FindObject("MilliMeter");
double accuracy = 0.5;
IParameterizedSurface[] objects1 = new IParameterizedSurface[1];
objects1[0] = face;
MeasureFaces measureFaces1;
measureFaces1 = workPart.MeasureManager.NewFaceProperties(unit1, unit2, accuracy, objects1);
area = measureFaces1.Area;
perimeter = measureFaces1.Perimeter;
measureFaces1.Dispose();
}
catch(Exception ex)
{
MessageBox.Show(ex.ToString());
area = perimeter = 0.0;
}
}
欢迎加入我的UGNX二次开发QQ群:282343540
转载于:https://www.cnblogs.com/yyFisheep/archive/2012/12/05/2802766.html
最后
以上就是爱笑石头为你收集整理的测量曲面的面积之NXOpen方法(UG(NX)二次开发)的全部内容,希望文章能够帮你解决测量曲面的面积之NXOpen方法(UG(NX)二次开发)所遇到的程序开发问题。
如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。
发表评论 取消回复