NX二次开发
一把油纸傘
这个作者很懒,什么都没留下…
展开
-
创建长方体通过倒圆变成圆柱
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here ...原创 2017-05-20 15:34:33 · 1970 阅读 · 0 评论 -
通过判断圆台边直径大小选择倒圆的角
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here Ses...原创 2017-05-19 18:54:00 · 909 阅读 · 0 评论 -
创建圆台并进行边倒圆
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here Sessi...原创 2017-05-19 18:52:19 · 1097 阅读 · 0 评论 -
C# NX二次开发_一键开关所有图层
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here Se...原创 2017-04-11 19:48:43 · 1445 阅读 · 0 评论 -
C# 创建体更改颜色和线型
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here ...原创 2017-04-09 22:03:35 · 1593 阅读 · 0 评论 -
C# NX创建球体
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here N...原创 2017-02-19 15:43:45 · 958 阅读 · 0 评论 -
C# NX创建方
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here NX...原创 2017-02-19 15:12:28 · 1101 阅读 · 3 评论 -
C# NX二次开发_创建圆柱体并进行编辑
NXOpen.Part workPart = theSession.Parts.Work; NXOpen.NXObject nXObject1 = null; do { NXOpen.Features.CylinderBuilder cylinderBuilder1 = workPart...原创 2017-02-12 18:48:33 · 5071 阅读 · 0 评论 -
C# NX创建圆
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here N...原创 2017-02-09 00:49:32 · 746 阅读 · 0 评论 -
C# NX创建点
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here ...原创 2017-02-08 23:59:56 · 1610 阅读 · 0 评论 -
C# NX 通过两点创建直线及更改线的颜色
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here N...原创 2017-02-08 23:27:45 · 1267 阅读 · 0 评论 -
C# NX二次开发_代码实现圆弧_1
public static int Main(string[] args) { int retValue = 0; try { theProgram = new Program(); //TODO: Add your application code here NXOp...原创 2017-02-07 23:10:59 · 1637 阅读 · 0 评论 -
UFUN发射线函数UF_MODL_trace_a_ray的用法(转,原文为C++,现在版本为C#)
本片源码例子非本人所创,不过是转换了开发语言版本,此例非常具有学习效果,原文请查看https://blog.csdn.net/lu1287580078/article/details/82916477?from=timeline Caesar卢尚宇CSDNclass FD_CreateTrace { private NXOpen.Session theSess...原创 2018-10-23 22:57:25 · 1058 阅读 · 1 评论 -
C#调用C/C++dll的方法(近期研究的课题)
转载自https://www.cnblogs.com/bizca/p/4962559.html bizca大神的博客NX Open,怎样取到面的环LOOP 在封装的ufun .NET库里面,对UF_MODL_ask_face_loops这个函数并没有封装,导致我们很多不便,那我们在.NET下怎样才能使用这个函数呢??当然是手动处理一下using System;using Sys...转载 2018-10-25 00:04:27 · 731 阅读 · 5 评论 -
用uf函数调用列表框
string[] items = new string[] { "AA", "BB", "-", "CC" }; int selIndex = theUfSession.Ui.DisplayMenu("Eric", 0, items, items.Length); return retValue;//这里调用的是UF里...原创 2017-05-20 23:05:17 · 570 阅读 · 0 评论 -
TOGGLE_BOTTON控件
TOGGLE_BUTTON ROBOT_PROGRAM_SHOW_PATH LABEL 显示位姿 BITMAP pdw_view VALUE ON ACTIONS ModuleCutting 多了一个属性:VALUE,ON表示开,OFF表示关转载 2017-05-21 23:10:02 · 377 阅读 · 0 评论 -
C# 扩展方法在NXOPEN中的应用(2)
举例:如果需要对NXopen中的Vector3D进行扩展一个反向的方法NagatedVectornamespace NXOpen //可以使用该命名空间{public static class Vector_eric //静态类{/// <summary> /// 反向矢量 /// </summary> ...原创 2017-12-30 12:09:38 · 1139 阅读 · 0 评论 -
NX选择对象设置过滤
用选择对象Selection在有特殊选择要求的情况下需要设置选择过滤。需要设置两个变量1.NXOpen.Selection.SelectionAction maskAction = NXOpen.Selection.SelectionAction.ClearAndEnableSpecific;(指示选择对象时要执行的操作的类型) 2.设置选择的具体类型过滤NXOpen.Sele...原创 2017-12-24 22:45:12 · 3545 阅读 · 0 评论 -
通过“选择对象控件”设置选择过滤器
private void UpdateEnum() { string enumAsString = this.centerLineType0.GetProperties().GetEnumAsString("Value"); Selection.MaskTriple maskTriple = default(Selection.MaskTriple);...转载 2017-09-26 16:07:43 · 1327 阅读 · 0 评论 -
用.lng文件翻译成中文
在模版中设置如上选项,自动加载startup文件夹中的.dll文件 卸载的方式则是当NX绘画窗口结束时代码:public static int Startup(){ int result = 0; try { Program.theProgram = newProgram(); UFSession uFSessio...原创 2017-09-21 11:59:16 · 1706 阅读 · 2 评论 -
快速设置面选择控件的选择范围
public void initialize_cb() { try { group1 = (NXOpen.BlockStyler.Group)theDialog.TopBlock.FindBlock("group1"); enum0 = (NXOpen.BlockStyler.Enumeration)theD...原创 2017-09-13 10:09:03 · 751 阅读 · 0 评论 -
关于解决NX重置之后“试图使用不活动的对象”
在执行Mian函数之前设置好私有字段,根据代码执行顺序Mian函数入口-构造函数-initialize(初始化对象)-dialogShown-Update对话框中已经选中对象之后就已经创建了Feature(特征)并且已经储存在了私有字段中,重置之后自动进入初始化之前的函数 if (BlockFeature != null) { t...原创 2017-09-11 21:38:05 · 994 阅读 · 0 评论 -
feauture 转换 Body
//特征里面可以有多个Body 要理解特征和实体的关系if (feature1 is BodyFeature) { BodyFeature bodyFeature1 = (BodyFeature) feature1; Body [] body1 = bodyFeature1.GetBodies(); } ...原创 2017-09-08 11:49:06 · 524 阅读 · 0 评论 -
选择多个面创建BOX
//設定選取過濾條件為只允許sheet body跟face private int init_proc(IntPtr select, IntPtr user_data) { UFUi.Mask[] masks = { new UFUi.Mask {object_type = UFConstants.UF_solid_type, ob...原创 2017-06-22 23:19:45 · 515 阅读 · 0 评论 -
创建对话框寻找多个面
//設定過濾條件 private int init_proc(IntPtr select, IntPtr user_data) { UFUi.Mask[] mask_faces = { new UFUi.Mask {object_type = UFConstants.UF_solid_type, object_subtype = 0...原创 2017-06-21 23:13:13 · 481 阅读 · 0 评论 -
创建曲线偏置根据指定矢量
public int apply_cb() { int errorCode = 0; try { //---- Enter your callback code here ----- TaggedObject[] curves = edge_select0.GetSelectedObjects...原创 2017-06-04 23:04:51 · 1224 阅读 · 1 评论 -
选择单条曲线偏置选择参考点
public int apply_cb() { int errorCode = 0; try { //---- Enter your callback code here ----- NXOpen.Session theSession = NXOpen.Session.GetSession(...原创 2017-06-02 21:40:53 · 1889 阅读 · 0 评论 -
创建包围盒子
public int apply_cb() { int errorCode = 0; try { //---- Enter your callback code here ----- Session theSession = Session.GetSession(); ...原创 2017-05-24 23:46:12 · 811 阅读 · 0 评论 -
创建双边偏置曲线(通过TOGGLE控件来控制是否保留原来的曲线)
public int apply_cb() { int errorCode = 0; try { //---- Enter your callback code here ----- NXOpen.TaggedObject[] curves = edge_selec...原创 2017-05-24 09:08:24 · 917 阅读 · 0 评论 -
创建选择对话框选择体
private static Selection.Response select_a_body(ref NXOpen.Tag body) { //Part workPart = theSession.Parts.Work; //Part displyPart = theSession.Parts.Display; string m...原创 2017-05-22 22:20:34 · 681 阅读 · 6 评论 -
C#之out和ref的用法区别&&NX获取面法相及中心点
懒得打字了,摘一段总结,但是我也是这么用和想的。“ref和out的区别在C# 中,既可以通过值也可以通过引用传递参数。通过引用传递参数允许函数成员更改参数的值,并保持该更改。若要通过引用传递参数, 可使用ref或out关键字。ref和out这两个关键字都能够提供相似的功效,其作用也很像C中的指针变量。它们的区别是:1、使用ref型参数时,传入的参数必须先被初始化。对out而言,必须在方...原创 2018-11-27 20:14:30 · 730 阅读 · 0 评论