UG/NX二次开发(C#) 获取组件里面的部件实体

UG/NX 二次开发(C#)自动出2D零件图(标准件配置Bata版) 这个版本已初具自动出2D图的雏形,能满足标准件经过配置后出图的基本需求,后面会继续挖掘并分享给大家,如果对源码感兴趣可以给我留言索要。同时也欢迎各位大佬提供宝贵意见和建议。 虽然没能实现自动出2D零件图,但是拿着去跟老板交差,应该勉强过关吧,毕竟也年底了,大家都想早点回家过年。 阅读详情

 部件一旦装配之后,UG会对部件进行封装,并生成新的tag,那我们如何去查找装配后的部件呢?

这里提供2种思路:

1、通过ufun函数获取;

2、通过NXOPEN遍历部件;

上代码:

        /// <summary>
        /// 通过ufun获取组件里的部件信息
        /// </summary>
        public static void GetBodyListFromComponet(ref List<Component> compList, ref List<Body> bodyList)
        {
            theSession = Session.GetSession();
            theUFSession = UFSession.GetUFSession();
            workPart = theSession.Parts.Work;
            compList = new List<Component>();
            bodyList = new List<Body>();
            ComponentTool.GetComponentList(workPart, compList);
            ComponentAssembly compAssembly = workPart.ComponentAssembly;
            Component rootComponent = compAssembly.RootComponent;
            foreach (Component c in compList)
            {
                SetWorkPart(c);
                workPart = theSession.Parts.Work;
                Tag objTag =
UG NX二次开发(C++)-UF_OBJ_cycle_all获取所有的体对象 在前面的一篇博客中,我们介绍了用UF_OBJ_cycle_objs_in_part遍历对象,后面我们用UF_OBJ_cycle_all这个方法来测试,发现还是UF_OBJ_cycle_objs_in_part比较准确些,具体为什么暂时还不清楚,如果有懂的请告知,不胜感激。 阅读详情

相关推荐

UG\NX二次开发 获取工作部件的事例 UF_ASSEM_ask_work_occurrence

获取工作部件的事例 UF_ASSEM_ask_work_occurrence。

王牌飞行员_里海的博客 635

NX二次开发 UFUN获取装配部件的有关信息 UF_ASSEM_ask_component_data

NX二次开发 UFUN获取装配部件的有关信息 UF_ASSEM_ask_component_data

梅雷的博客 531

UG NX二次开发中的组件遍历(C#)

/// <summary> /// 通过遍历获取装配体的全部组件 /// </summary> /// <param name="part">工作部件</param> /// <param name="componentsL...

GimiGimmy 5148

UG NX二次开发-博客文章速览

写了一些UG NX二次开发的心得体会,内容较多,感觉不好查找相应的内容,所以决心把导航写出来,方便自己也方便读者。主专栏是“”,C#专栏为 : “” ,Python专栏为 : “这三个专栏都会持续的更新。如果有需要咨询或者学习讨论的,请私信博主或者加QQ群:749492565。博主几乎每天都在。

GimiGimmy 3717

UG\NX二次开发书籍推荐

UG\NX二次开发书籍推荐

王牌飞行员_里海的博客 4245

UG NX二次开发(C#)-装配-替换组件

UG NX二次开发中替换组件代码

GimiGimmy 6294

UG NX二次开发简介与几种语言的范例

UG NX二次开发是在UG NX软件平台上进行自定义开发和编程,以满足特定业务流程和需求的过程。UG NX二次开发可以使用户获取更高的生产效率、更高的生产质量、更高的数据安全性等优势。UG NX二次开发包括以下方面:1.自定义应用程序开发,包括自定义功能和界面控制。2.自定义脚本编写,以实现特定的自动化任务。3.自定义API开发,包括自定义命令、函数、传感器等。4.自定义数据导入导出,包括实现与其他系统之间的数据交换。

GimiGimmy 2809

UG NX 次开发 - 外部模式 C#: 用 C# 进行 UG NX 的二次开发

在 C# 项目中,需要引用 UG NX 的程序集,以便能够访问 UG NX 的对象和函数。在"引用管理器"对话框中,选择"浏览"选项卡,并浏览到 UG NX 安装目录下的 “NXBIN” 文件夹,选择"NXOpen.dll" 和 “NXOpen.Utilities.dll” 等程序集进行引用。我们了解了如何设置开发环境并引用 UG NX 的程序集,然后通过编写代码示例演示了如何在 UG NX 中创建一个新的零件文件并添加一个圆柱体。在某些情况下,用户可能需要对 UG NX 进行二次开发,以满足特定的需求。

HackQuestR的博客 1582

UG NX二次开发(C#)-CAM-获取所有的加工刀具表单

UG NX软件最擅长的就是生成加工程序,包括了车加工、铣加工、钻加工等等。在二次开发过程中,有时需要获取模型中已经添加的加工刀具表单。本文讲解一下如何获取加工刀具。

GimiGimmy 3475

UG NX二次开发(C#)-建模-获取圆柱面信息(轴向、半径、深度)

获取圆柱面的信息前言一、在UG NX中面的类型有哪些?二、获取圆柱面信息的函数1.获取半径和轴向2、计算圆柱面的深度值3、测试用例总结 文章目录前言一、在UG NX中面的类型有哪些?二、获取圆柱面信息的函数1.获取半径和轴向2、计算圆柱面的深度值3、测试用例总结 前言 在一个项目中,需要遍历曲面,获得所有的圆柱面和圆柱面的信息,包括轴向、半径和圆柱面的深度。经过研究,采用uFModl.AskFaceData(face.Tag, out faceTypeInt, point, dir, box, out

GimiGimmy 4145

UG NX二次开发(C#)-获取模型文件的预览图片

UG NX保持的prt文件中保存了模型的预览位图,但是采用UG NX二次开发时不能直接提取出来,本文讲解一下将prt文件的预览位图提取出来并单独保存。如果我们在UG NX中打开过某个prt文件,在历史记录中能看到曾经打开的模型文件,如下图所示:在历史记录中显示的图片就是保存模型文件中得预览图。如果我们将模型文件的背景修改了,然后另存到一个新的地址中,其保存的预览图就会更改为最后修改后的图,如上图的第二张图就是更改后保存的预览图。

GimiGimmy 2253

UG NX二次开发(C#)-装配-添加组件AddComponent

在UG NX的使用过程中,装配是很重要的一环,本文是为了实现组件的批量装配,采用UG NX二次开发,采用的主要函数为AddComponent。 AddComponent()的帮助说明如下: 其是属于NXOpen.Assemblies空间的ComponentAssembly类, 采用: using NXOpen.Assemblies; 其实现代码如下: /// <summary> /// 添加组件 /// </summary>

GimiGimmy 3061

UG NX二次开发(C#)-VS2022配置NX二次开发模板不能正常显示的问题

随着VS2022的发布,使用VS2022进行UG NX二次开发的人员也会越来越多,但是由于VS2022和以前的VS版本采用代码结构不同,而UG NX的二次开发编程模板还没有适应于VS2022的模板配置,所以不能正常的创建一个完整的工程。本文采用曲线救国的方式来实现VS2022下的UG NX二次开发。如果有读者能很好的解决模板配置,不吝赐教。

GimiGimmy 4276

UG NX二次开发(C#)-CAM-采用内部函数获取drill操作的进给

最近做个项目,需要提取drill操作的进给信息,采用NXOpen二次开发时,其读取的工序操作是NXOpen.CAM.Operation,不能直接获取进给和主轴转速,这个可以通过内部函数来获取。本系列是针对CAM的模块,以便于读者方便查看博客。感兴趣的或者有疑问需要咨询的可以进QQ群:749492565,也可以私信博主,我几乎天天都在。

GimiGimmy 2106

【AMD显卡在WIndow10/11部署带GPU支持的深度学习环境(Pytorch-DirectML篇)】

这篇是之前Tensorflow-DirectML的姊妹篇,如果对TF感兴趣的可以搜索我的博文。 首先我们丢一个官网地址,但是官网那个会误导新人如果你按那个操作的话。 https://docs.microsoft.com/en-us/windows/ai/directml/gpu-pytorch-windows 这里用我的方法操作: 首先声明一下,因为我的显卡是AMD RX6600,不带XT(性能和RTX3060 12G版本半斤八两),所以目前没有最新的WSL2驱动,如果有了的话欢迎告知我,所以我这里就.

weixin_44029053的博客 2万+

Kubernetes多网卡环境下Calico网络配置避坑指南:如何精准指定业务网卡

本文针对Kubernetes多网卡环境下Calico网络配置的常见痛点,提供了精准指定业务网卡的实战指南。通过深入分析Calico的IP自动检测机制,详细解读并对比了五种IP_AUTODETECTION_METHOD配置方法(如interface、cidr、can-reach等),帮助运维人员从根源上解决网络分区和Pod通信失败问题,确保生产集群网络的稳定与可靠。

weixin_28835551的博客 730

比Synergy更轻量!Barrier鼠标共享工具实测:5分钟实现Win/Mac/Linux三设备无缝切换

本文实测了开源免费的Barrier鼠标共享工具,详细指导用户如何在5分钟内于Windows、macOS和Linux三台设备间实现一套键鼠的无缝切换。文章对比了其与Synergy的优势,提供了分平台安装、核心服务端-客户端配置、防火墙设置等完整教程,并分享了解决连接问题的关键技巧,是提升多设备办公效率的实用指南。

weixin_29304021的博客 599

WebRTC音频传输实战:从采集到播放的完整链路解析(附RTP包处理细节)

本文深入解析了WebRTC音频传输的完整链路,从麦克风采集、音频处理与编码,到RTP打包、网络发送,再到接收端的NetEQ抗抖动处理与最终播放。文章以Linux PulseAudio为例,详细剖析了线程模型、缓冲区管理及RTP包处理等关键细节,旨在帮助开发者优化实时音频应用的延迟、卡顿与回声问题。

tea88的博客 853

12.工具高级参数CogCalibNPointToNPointTool

CogCalibNPointToNPointTool是一种多点2D坐标校正工具,用于将图像像素坐标转换为物理世界坐标。该工具通过两组点(图像坐标点和物理坐标点)计算最佳转换关系,并将结果保存供后续使用。操作步骤包括获取图像、添加坐标点对、计算转换参数。校正结果会显示平移、缩放、旋转等参数及RMS误差值,较大的误差可能表明点位置不准确或自由度不足。该工具广泛应用于机器视觉领域,通过9点标定等案例可验证坐标转换的准确性并优化参数设置。

204

【Claude Code的Harness Engineering实现】:06-记忆系统(Memory)

记忆系统是Claude Code实现跨会话持久化和上下文保持的核心组件。它分为短期记忆(当前会话的对话历史)和长期记忆(跨会话保留的结构化信息),通过多层级的文件系统实现灵活的记忆管理。

rengang66的博客 240

AD9361功能介绍和使用

AD9361使用分数分频锁相环(PLL)来产生发射机和接收机本地振荡器(LO)频率和BB PLL。BB PLL 可用于数据转换、数字滤波器和 |/O 端口。PLL的参考时钟可以由外部振荡器或外部晶体(XO)和数字可编程片内可变电容提供,电容微调产生参考时钟频率,XO和微调电容的组合统称为DCXO。有多个天线输入的分集系统。接收链数据首先经过低噪声放大器(LNA),然后是同相(1)和正交(Q)放大器,混频器和频带整形滤波器,可将接收到的信号下变频为基带以进行数字化。时分双工(TDD)和频分双工(FDD)。。。

wangjie36的博客 1万+

微信小程序 - 解决报错 {“errcode“:41002,“errmsg“:“appid missing, rid: X“} 微信报错错误码errcode“:41002问题分析及解决教程(详细排查)

【微信小程序】报错{“errcode“:41002,“errmsg“:“appid missing, rid: 64e55770-67c1fb7e-027c5a70“}:【微信小程序】微信小程序登录请求出现appid missing提示,微信公众号{"errcode":41002,"errmsg":"appid missing"},微信 报错{“errcode“:41002,“errmsg“:“appid missing,微信小程序获取openid返回appid missing的问题,微信小程序提示Erro

🏆 前端领域优质创作者 5659

精雕软件(JDpaint) 5.5 绿色版

精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版精雕软件(JDpaint) 5.5 绿色版

数学建模模型总结

这是本人在两年内准备参加数学建模竞赛搜集到的模型资料,已经经过了本人的筛选和整理,希望能够对准备参加数学建模竞赛的学弟学妹们提供一些帮助!

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

OV9734 DATASHEET,完整规格书

OV9734完整规格书,包括电气参数,尺寸规格,寄存器配置表等

上一篇: UG/NX二次开发(C#) 一个方法遍历部件的体、面、边属性
下一篇: UG/NX 二次开发(C#) 获取曲面的中心点坐标
MarcoPro
博客等级 码龄4年 415粉丝 144原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

MarcoPro

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值