iCAx开思工具箱

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 24555|回复: 0
打印 上一主题 下一主题

帮忙看看这段程序错在哪儿啊?

[复制链接]
跳转到指定楼层
楼主
发表于 2006-5-29 18:35:02 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

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

红色部分出错,可是我实在找不出错在哪?高手们帮忙看一下啊!
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 支持支持
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手板模型制作,在线3D打印服务

QQ|小黑屋|手机版|开思工具箱 CAD工具箱_CAM工具箱  

GMT+8, 2024-11-16 21:59 , Processed in 0.010783 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

快速回复 返回顶部 返回列表