///
/// 导入Part文件
///
/// part文件全路径
/// 无用,是为了区别NXOpen的函数
public static void ImportPartFun(string importFileFullPath,bool flag)
{
ImportPartModes importPartModes = new ImportPartModes();
importPartModes.layer_mode = 0;
importPartModes.group_mode = 0;
importPartModes.layer_mode = 1;
importPartModes.view_mode = 0;
importPartModes.view_mode = 1;
importPartModes.cam_mode = false;
importPartModes.csys_mode = 1;
double[] csys = new double[6] { 1, 0, 0, 0, 1, 0};
double[] point = new double[] {0,0,0 };
Tag tag = new Tag();
double scale = 1.0;
uFPart.Import(importFileFullPath,ref importPartModes,csys,point,scale, out tag);
}
///
/// 导入Part文件
///
/// part文件全路径
public static void ImportPartFun(string importFileFullPath)
{
NXOpen.PartImporter partImporter1;
partImporter1 = workPart.ImportManager.CreatePartImporter();
partImporter1.FileName = importFileFullPath;
partImporter1.Scale = 1.0;
partImporter1.CreateNamedGroup = false;
partImporter1.ImportViews = false;
partImporter1.ImportCamObjects = false;
partImporter1.LayerOption = NXOpen.PartImporter.LayerOptionType.Work;
partImporter1.DestinationCoordinateSystemSpecification = NXOpen.PartImporter.DestinationCoordinateSystemSpecificationType.Work;
NXOpen.Matrix3x3 element1 = new NXOpen.Matrix3x3();
element1.Xx = 1.0;
element1.Xy = 0.0;
element1.Xz = 0.0;
element1.Yx = 0.0;
element1.Yy = 1.0;
element1.Yz = 0.0;
element1.Zx = 0.0;
element1.Zy = 0.0;
element1.Zz = 1.0;
NXOpen.NXMatrix nXMatrix1;
nXMatrix1 = workPart.NXMatrices.Create(element1);
partImporter1.DestinationCoordinateSystem = nXMatrix1;
NXOpen.Point3d destinationPoint1 = new NXOpen.Point3d(0.0, 0.0, 0.0);
partImporter1.DestinationPoint = destinationPoint1;
NXOpen.NXObject nXObject1;
nXObject1 = partImporter1.Commit();
partImporter1.Destroy();
}
服务器托管,北京服务器托管,服务器租用 http://www.fwqtg.net
机房租用,北京机房租用,IDC机房托管, http://www.e1idc.net