本实例主要实现了通过ufun创建圆柱和简单孔,主要使用了一下几个ufun函数:
theUFSession.Modl.CreateCyl1 创建圆柱
theUFSession.Modl.AskFeatFaces 获取面列表
theUFSession.Modl.CreateSimpleHole 创建简单孔
最终实现效果图如下:
一、主程序
先看实现简单孔的主程序如下:
using System;
using NXOpen;
using NXOpen.UF;
using NxLibrary;
public class Program
{
private static Session theSession;
private static UFSession theUFSession;
public static Program theProgram;
private static UI theUI = null;
public static int Main(string[] args)
{
theUI = UI.GetUI();
int retValue = 0;
try
{
#region 简单孔
double[] origin = new double[3] { 0.0, 0.0, 0.0 };
double[] direction = new double[3] { 0.0, 0.0, 1.0 };
string height