.net ug 二次开发 nx1872 (第四天)

1.视图是否存在

 1 Option Strict Off
 2 Imports NXOpen
 3 
 4 Module Module1
 5     Sub Main()
 6 
 7         Dim theSession As Session = Session.GetSession()
 8         Dim workPart As Part = theSession.Parts.Work
 9         Dim tmpviewname As String = ""
10         Dim tmpExist As Boolean = False
11         Try
12             tmpviewname = workPart.ModelingViews.FindObject("tmp").Name '查询视图tmp的名称
13             tmpExist = True '存在就true
14         Catch ex As Exception
15             tmpviewname = "tmp"
16             tmpExist = False '不存在就false
17         End Try
18         MsgBox("viewname: " & tmpviewname & vbCrLf & "tmpExist: " & tmpExist)
19     End Sub
20 End Module

 

上一篇:Python 通过 .cube LUT 文件对图像加滤镜


下一篇:Excel开发者模式学习(2)——数据类型、变量、常量、数组