找回密码 注册 QQ登录
一站式解决方案

iCAx开思网

CAD/CAM/CAE/设计/模具 高清视频【积分说明】如何快速获得积分?在线3D打印服务,一键上传,自动报价 
查看: 16212|回复: 3
打印 上一主题 下一主题

Cam-yp VB.net 和 grip接口

[复制链接]
跳转到指定楼层
1
发表于 2007-12-1 08:08:22 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册,结交更多同行朋友,交流,分享,学习。

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

x
VB.net
Option Strict Off  

Imports System
Imports NXOpen
Imports NXOpen.UF
Imports NXOpenUI
Imports NXOpen.UI
Imports NXOpen.Utilities

Module call_grip_from_vb_and_print_args

  Dim s As Session = Session.GetSession()
  Dim ui As UI = GetUI()

Sub Main()

Try
    Dim num1 As Double = 2.0
    Dim num2 As Double = 55.2
    Dim text1 As String = "Otto"
    Dim text2 As String = "Karl"
    Dim inputArgs(3) As Object
    Dim gripObj() As Object
   
    inputArgs(0) = num1
    inputArgs(1) = num2
    inputArgs(2) = text1
    inputArgs(3) = text2

    ui.LockAccess()

    Dim grip_executable As String = "c:\print_api_args.grx"

    gripObj = s.ExecuteGrip(grip_executable, inputArgs)

    ui.UnlockAccess()

Catch ex As Exception
    s.ListingWindow.Open()
    s.ListingWindow.WriteLine("Error: ")
    s.ListingWindow.WriteLine(ex.GetBaseException.ToString())
End Try

End Sub

  Public Function GetUnloadOption(ByVal dummy As String) As Integer

      Return Session.LibraryUnloadOption.Immediately

  End Function

End Module


'-----------------------------------------------
'$$ GRIP Source called by VB.NET
'$$ Please remove the first character
'$$ in each line to compile!
'$$
'$$ Declarations.
'    number / zahl1, zahl2
'    entity / object
'    string / text1(132), text2(132)
'   
'$$ Register and initialize the argument list
'    ufargs / zahl1, zahl2, text1, text2
'
'$$ Print the arguments
'    PRINT/ 'Argument1 = ' + FSTR(zahl1)
'    PRINT/ 'Argument2 = ' + FSTR(zahl2)
'    PRINT/ 'Argument3 = ' + text1
'    PRINT/ 'Argument4 = ' + text2
'
'$$ Return control to the VB program.
'    halt: halt
'-----------------------------------------------
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享淘帖 赞一下!赞一下!
2
发表于 2007-12-1 08:38:49 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

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

x
3
发表于 2007-12-1 09:06:57 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

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

x
4
发表于 2007-12-8 19:37:08 | 只看该作者

马上注册,结交更多同行朋友,交流,分享,学习。

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

x
您需要登录后才可以回帖 登录 | 注册

本版积分规则

3D打印手板模型快速制作服务,在线报价下单!

QQ 咨询|手机版|联系我们|iCAx开思网  

GMT+8, 2024-9-22 06:45 , Processed in 0.042621 second(s), 11 queries , Gzip On, Redis On.

Powered by Discuz! X3.3

© 2002-2024 www.iCAx.org

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