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作者: zhangcanwei 时间: 2008-11-2 11:06
这是完整工程文件作者: zhangcanwei 时间: 2008-11-2 11:11
附注:
代码用visual studio 2005编写,用2008可直接打开
NX必须是5.0或者以上版本。