马上注册,结交更多同行朋友,交流,分享,学习。
您需要 登录 才可以下载或查看,没有帐号?注册
x
这是源代码:
Imports System
Imports NXOpen
Imports NXOpenUI
Imports NXOpen.UF
Module CreatCircle
Public theSession As Session = Session.GetSession()
Public TheUFsess As UFSession = UFSession.GetUFSession()
Private Sub SelectPoint(ByVal messageStr As String, ByRef SelectPoint() As Double) '-选点
Dim ThisMeoth As NXOpen.UF.UFUi.PointBaseMethod = UFUi.PointBaseMethod.PointEndPt '--表示选点对话框默认为选取端点
Dim SelectPointTag As Tag
Dim inputInteger As Integer = 0
TheUFsess.Ui.PointConstruct(messageStr, ThisMeoth, SelectPointTag, SelectPoint, inputInteger)
End Sub
Sub Main()
Dim pt1(2) As Double
Dim pt2(2) As Double
Dim pt3(2) As Double
Dim create_flag As Integer = 2 '--表示要画整圆
Dim arc_tag As Tag = Tag.Null
SelectPoint("选取第一点", pt1)
SelectPoint("选取第二点", pt2)
SelectPoint("选取第三点", pt3)
TheUFsess.Curve.CreateArcThru3pts(create_flag, pt1, pt2, pt3, arc_tag)
End Sub
Public Function GetUnloadOption() As Integer
Return Session.LibraryUnloadOption.Immediately '--表示程序运行完毕后立即从ug环境卸载
End Function
End Module |