iCAx开思工具箱

标题: 帮忙看看这段程序错在哪儿啊? [打印本页]

作者: mengfankun    时间: 2006-5-29 18:35
标题: 帮忙看看这段程序错在哪儿啊?
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

红色部分出错,可是我实在找不出错在哪?高手们帮忙看一下啊!




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3