|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
Dim thesession As session
Dim theufsession As UFSession
Sub Main()
thesession = Session.GetSession
theufsession = UFSession.GetUFSession
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = thesession.Parts.Display
Dim origin As Point3d
origin.X = 20
origin.Y = 0
origin.Z = 0
Dim text(1) As String
text(0) = "This is a LABEL."
text(1) = "It points"
Dim attachview As NXOpen.View
Dim leader As LeaderBundle
leader = workPart.Annotations.NewLeaderBundle()
Dim endpoint As Point3d
endpoint.X = 100
endpoint.Y = 0
endpoint.Z = 0
Dim angle As Double = 0
Dim interpoints(0) As Point3d
interpoints(0).X = 50
interpoints(0).Y = 0
interpoints(0).Z = 0
Dim lable1 As NXOpen.Annotations.Label
Dim lineandarrow As LineAndArrowPreferences
lineandarrow = workPart.Annotations.Preferences.GetLineAndArrowPreferences()
lable1 = workPart.Annotations.CreateLabel(text, origin, Nothing, Nothing, lineandarrow, leader)
leader.LeaderAlignment = LeaderAlignment.Middle
leader.LeaderSide = LeaderSide.Left
leader.LeaderType = LeaderType.Plain
leader.NumberOfLeaders = 1
leader.SetLeaderData(1, LeaderAttachment.Screen, Nothing, attachview, endpoint, angle, interpoints)
End Sub
红色部分出错,可是我实在找不出错在哪?高手们帮忙看一下啊! |
|