新闻详情

新闻详情

首页 / 资讯中心 / 详情

010.UG二次开发,自定义ui模拟ug12.0草图选择框

发布时间:2026/9/6 21:28:02来源:尧图网络
010.UG二次开发,自定义ui模拟ug12.0草图选择框
ug12.0的草图选择框UI非常的智能,例如选择平面中的自动判断,当我们选择两个面,他会自动推断选择两个面之间的中面,还有其他许多高级智能推断等等.在拉伸,旋转等等命令中的内部草图中都有这个智能草图选择框可以调用,加上旧草图约束算法,工作效率是新版西门子软件的4-5倍以上.西门子ug软件在18系列以后放弃了机械设计模块,草图框架也改得面目全非,可以说从18系列以后的所有ug版本软件,全部无法用于正常工作.最显著的影响就是草图框架的封装,无论是新建草图,还是拉伸,旋转等内部草图,在选择工作草图平面时的逻辑被改得极其弱智,工作效率直接归0.虽然,新版本ug软件有种种不堪,但底层的技术毕竟更新了10几年,不能因为他不堪重用就一直使用旧软件.本节内容主要解决的痛点就是:"用插件去模拟ug12.0的草图选择框ui,快速新建出智能判断草图平面的草图,结合旧草图约束设置,实现高版本ug像ug12.0一样提高4-5倍的工作效率"高版本ug的拉伸,旋转等等命令的内部草图ui基本封装了弱智的草图选择框ui,我们不可能每一个命令都去写一套代码,插件,于是,我们用曲线救国的方法,让我们的插件只模拟新建外部草图,有了草图后我们再用这个草图去完成拉伸或旋转,效果是一样的一.接009篇内容,将给ui界面加上功能优化ui类,主要优化是 回调函数apply_cb(),这个函数是ui界面的确认按键按下后会触发这个回调函数,我们在中国回调函数中将选择是平面,矢量,点传给草图,并new一个草图,就实现了ug12.0的高级草图选择框using NXOpen; using NXOpen.BlockStyler; using NXOpen.CAE; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace UG_Sketsh { public class BlockStyler001 { //class members private static Session theSession = null; private static UI theUI = null; private string theDlxFileName; private NXOpen.BlockStyler.BlockDialog theDialog; private NXOpen.BlockStyler.Label label0;//标签 private NXOpen.BlockStyler.SpecifyPlane plane0;// Block type: 指定平面 private NXOpen.BlockStyler.Separator separator0;// Block type: 分割线 private NXOpen.BlockStyler.Label label01;// 标签 private NXOpen.BlockStyler.SpecifyVector vector0;// Block type: 指定矢量 private NXOpen.BlockStyler.Separator separator01;// Block type: 分割线 private NXOpen.BlockStyler.Label label02;// Block type:标签 private NXOpen.BlockStyler.Separator separator02;// Block type: 分割线 private NXOpen.BlockStyler.SpecifyPoint point0;// Block type: 指定点 private NXOpen.BlockStyler.ScrolledWindow scrolledWindow;// Block type: 滚动窗口 public static readonly int SnapPointTypesOnByDefault_UserDefined = (1 0); public static readonly int SnapPointTypesOnByDefault_Inferred = (1 1); public static readonly int SnapPointTypesOnByDefault_ScreenPosition = (1 2); public static readonly int SnapPointTypesOnByDefault_EndPoint = (1 3); public static readonly int SnapPointTypesOnByDefault_MidPoint = (1 4); public static readonly int SnapPointTypesOnByDefault_ControlPoint = (1 5); public static readonly int SnapPointTypesOnByDefault_Intersection = (1 6); public static readonly int SnapPointTypesOnByDefault_ArcCenter = (1 7); public static readonly int SnapPointTypesOnByDefault_QuadrantPoint = (1 8); public static readonly int SnapPointTypesOnByDefault_ExistingPoint = (1 9); public static readonly int SnapPointTypesOnByDefault_PointonCurve = (1 10); public static readonly int SnapPointTypesOnByDefault_PointonSurface = (1 11); public static readonly int SnapPointTypesOnByDefault_PointConstructor = (1 12); public static readonly int SnapPointTypesOnByDefault_TwocurveIntersection = (1 13); public static readonly int SnapPointTypesOnByDefault_TangentPoint = (1 14); public static readonly int SnapPointTypesOnByDefault_Poles = (1 15); public static readonly int SnapPointTypesOnByDefault_BoundedGridPoint = (1 16); public static readonly int SnapPointTypesOnByDefault_FacetVertexPoint = (1 17); public static readonly int SnapPointTypesOnByDefault_DefiningPoint = (1 18); //------------------------------------------------------------------------------ //Bit Option for Property: SnapPointTypesEnabled //------------------------------------------------------------------------------ public static readonly int SnapPointTypesEnabled_UserDefined = (1 0); public static readonly int SnapPointTypesEnabled_Inferred = (1 l
网站建设高端定制企业官网
RELATED

相关资讯

更多精彩内容,欢迎继续阅读

较早相关资讯

最新相关资讯

Video2X:免费AI视频超分框架,把老视频拉到4K只要一条命令 2026/9/6 21:25:49

Video2X:免费AI视频超分框架,把老视频拉到4K只要一条命令

Video2X:免费AI视频超分框架,把老视频拉到4K只要一条命令 【免费下载链接】video2x A machine learning-based video super resolution and frame interpolation framework. Est. Hack the Valley II, 2018. 项目地址: https://gitcode.com/GitHub_Tre…

阅读更多 →
Video2X:免费 AI 把 480p 老视频放大 4 倍成 4K,顺手补帧到 60fps 2026/9/6 21:25:49

Video2X:免费 AI 把 480p 老视频放大 4 倍成 4K,顺手补帧到 60fps

Video2X:免费 AI 把 480p 老视频放大 4 倍成 4K,顺手补帧到 60fps 【免费下载链接】video2x A machine learning-based video super resolution and frame interpolation framework. Est. Hack the Valley II, 2018. 项目地址: https://gitcode.com/Gi…

阅读更多 →
oh-my-claudecode:Claude Code 多智能体编排完全指南 —— Team 流水线、魔法关键词与技能学习实战 2026/9/6 21:25:49

oh-my-claudecode:Claude Code 多智能体编排完全指南 —— Team 流水线、魔法关键词与技能学习实战

oh-my-claudecode:Claude Code 多智能体编排完全指南 —— Team 流水线、魔法关键词与技能学习实战 【免费下载链接】oh-my-claudecode Teams-first Multi-agent orchestration for Claude Code 项目地址: https://gitcode.com/GitHub_Trending/oh/oh-my-claudeco…

阅读更多 →
fuels-ts 自定义交易实战:用 ScriptTransactionRequest 与 assembleTx 完成多资产转账到合约 2026/9/6 21:25:49

fuels-ts 自定义交易实战:用 ScriptTransactionRequest 与 assembleTx 完成多资产转账到合约

fuels-ts 自定义交易实战:用 ScriptTransactionRequest 与 assembleTx 完成多资产转账到合约 【免费下载链接】fuels-ts Fuel Network Typescript SDK 项目地址: https://gitcode.com/GitHub_Trending/fu/fuels-ts 本篇基于 fuels-ts 官方文档《Custom Trans…

阅读更多 →
Buzz 离线语音转录指南:本地 Whisper 把录音转成文字与字幕 2026/9/6 21:25:49

Buzz 离线语音转录指南:本地 Whisper 把录音转成文字与字幕

Buzz 离线语音转录指南:本地 Whisper 把录音转成文字与字幕 【免费下载链接】buzz Buzz transcribes and translates audio offline on your personal computer. Powered by OpenAIs Whisper. 项目地址: https://gitcode.com/GitHub_Trending/buz/buzz 处理采…

阅读更多 →
Vissim动态交通分配(DTA)核心机制与实操经验详解 2026/9/6 21:22:48

Vissim动态交通分配(DTA)核心机制与实操经验详解

简介:面向VISSIM交通仿真学习者与交通规划人员,这份PDF系统讲解了动态交通分配(DTA)的核心定义与应用方法。内容涵盖动态交通分配的概念、迭代仿真原则、前期准备要点及节点、通路、停车场等建模工具,并结合OD矩阵、修…

阅读更多 →

今日资讯

本周资讯

本月资讯

看完文章仍有疑问?

联系尧图顾问,获取一对一建站咨询

立即免费咨询 📞 400-888-8888
📞