NX二次开发之程序组及操作重命名

更新时间:2023-07-18 22:27:55 阅读: 评论:0

NX⼆次开发之程序组及操作重命名Option Strict Off
有关祖国的作文
Imports System
Imports System.IO
Imports System.Windows.Forms
Imports NXOpen
Imports NXOpen.UF
Imports NXOpen.Utilities
允禧Module TestRenameCamObjects
Dim theSession    As Session  = Session.GetSession()
Dim theUFSession  As UFSession = UFSession.GetUFSession()卤菜怎么做
Dim theUI        As UI        = UI.GetUI()
Dim TempPath      As String    = Environment.GetEnvironmentVariable("TMP")
Dim UGRelea    As String    = Nothing
三薪是哪几天Dim UGFullRelea As String    = Nothing
Sub Main(Args As String())
theSession.LogFile.WriteLine("Executing ... " & _
System.Reflection.Asmbly.GetExecutingAsmbly().Location)
Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo("en-US")
Threading.Thread.CurrentThread.CurrentUICulture = New Globalization.CultureInfo("en-US")
UGRelea = theSession.GetEnvironmentVariableValue("UGII_VERSION")
UGFullRelea = theSession.GetEnvironmentVariableValue("UGII_FULL_VERSION")
System.Windows.Forms.Application.EnableVisualStyles()
Dim MyUndoMark As Session.UndoMarkId = _
theSession.SetUndoMark(Session.MarkVisibility.Visible, "TestRenameCamObjects")
' uncomment the following lines to check for the correct application
Dim AppID As Integer = UFConstants.UF_APP_NONE汴梁八景
theUFSession.UF.AskApplicationModule(AppID)
If AppID <> UFConstants.UF_APP_CAM Then
theUI.NXMessageBox.Show("Application missmatch", NXMessageBox.DialogType.Error, "No NX CAM ssion, Exiting!")            Exit Sub
End If
For i As Integer = 0 To theUI.SelectionManager.GetNumSelectedObjects() - 1
Dim theSelectedObject As TaggedObject = theUI.SelectionManager.GetSelectedTaggedObject(i)
If theSession.Parts.Work.CAMSetup.IsGroup(theSelectedObject) Then
Dim thePartName As String = IO.Path.GetFileNameWithoutExtension(theSession.Parts.Work.FullPath)
Dim theIndex As String = NXOpenUI.NXInputBox.GetInputString("Enter Index")
Dim theGroupName As String = Left(thePartName, 12).Replace("-", "_") & "_" & theIndex & "_" & Right(thePartName, 4)                Dim theNcGroup As CAM.NCGroup = CType(theSelectedObject, CAM.NCGroup)
theNcGroup.SetName(theGroupName)
Dim theCounter As Integer = 0
For Each theCAMObject As CAM.CAMObject In theNcGroup.GetMembers()
If theSession.Parts.Work.CAMSetup.IsOperation(theCAMObject) Then
theCAMObject.SetName(theCounter.ToString("00") & "_" & theCAMObject.Name)蔬菜种植
theCounter += 1
If theCounter > 99 Then Exit For
End If
Next
End If
Next
End Sub
Public Function GetUnloadOption(ByVal dummy As String) As Integer年后找工作好找吗
Return CInt(Session.LibraryUnloadOption.Immediately)似玉生香
End Function
End Module

本文发布于:2023-07-18 22:27:55,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1086926.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:组及   程序   操作
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图