zoukankan      html  css  js  c++  java
  • NX CAM 读取加工参数

    '取加工几何试图程序组

    Function GetGemoGroup_Name(ByVal camObjectTag As NXOpen.Tag) As String

    Dim theGemoGroupTag As NXOpen.Tag

    Dim gemoGroupName As String = ""

    theUfSession.Oper.AskGeomGroup(camObjectTag, theGemoGroupTag)

    theUfSession.Obj.AskName(theGemoGroupTag, gemoGroupName)

    Return gemoGroupName

    End Function

     

    '取操作名称

    Function GetToolPathName(ByVal camObjectTag As NXOpen.Tag) As String

    Dim toolPathName As String = ""

    theUfSession.Oper.AskNameFromTag(camObjectTag, toolPathName)

    Return toolPathName

    End Function

     

    '获取刀具名称

    Function GetToolName(ByVal camObjectTag As NXOpen.Tag) As String

    Dim toolName As String = ""

    Dim toolTag As NXOpen.Tag

    theUfSession.Oper.AskCutterGroup(camObjectTag, toolTag)

    theUfSession.Obj.AskName(toolTag, toolName)

    Return toolName

    End Function

     

    '获取刀具号码

    Function GetToolNumber(ByVal camObjectTag As NXOpen.Tag) As Integer

    Dim toolTag As NXOpen.Tag

    Dim toolNumber As Integer

    theUfSession.Oper.AskCutterGroup(camObjectTag, toolTag)

    theUfSession.Param.AskIntValue(toolTag, NXOpen.UF.UFConstants.UF_PARAM_TL_NUMBER, toolNumber)

    Return toolNumber

    End Function

     

    '获取刀具长度

    Function GetToolHeight(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim toolTag As NXOpen.Tag

    Dim toolHeight As Double

    theUfSession.Oper.AskCutterGroup(camObjectTag, toolTag)

    theUfSession.Param.AskDoubleValue(toolTag, NXOpen.UF.UFConstants.UF_PARAM_TL_HEIGHT, toolHeight)

    Return toolHeight

    End Function

     

    '获取刀具直径

    Function GetToolDiameter(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim toolTag As NXOpen.Tag

    Dim toolDiameter As Double

    theUfSession.Oper.AskCutterGroup(camObjectTag, toolTag)

    theUfSession.Param.AskDoubleValue(toolTag, NXOpen.UF.UFConstants.UF_PARAM_TL_DIAMETER, toolDiameter)

    Return toolDiameter

    End Function

     

    '获取刀具刃长

    Function GetToolFluteLength(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim toolTag As NXOpen.Tag

    Dim toolFluteLength As Double

    theUfSession.Oper.AskCutterGroup(camObjectTag, toolTag)

    theUfSession.Param.AskDoubleValue(toolTag, NXOpen.UF.UFConstants.UF_PARAM_TL_FLUTE_LN, toolFluteLength)

    Return toolFluteLength

    End Function

     

    '获取刀具R

    Function GetToolCornerRadius(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim toolTag As NXOpen.Tag

    Dim toolCornerRadius As Double

    theUfSession.Oper.AskCutterGroup(camObjectTag, toolTag)

    theUfSession.Param.AskDoubleValue(toolTag, NXOpen.UF.UFConstants.UF_PARAM_TL_COR1_RAD, toolCornerRadius)

    Return toolCornerRadius

    End Function

     

    '取部件侧部余量

    Function GetStockPart(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim stockPart As Double

    theUfSession.Param.AskDoubleValue(camObjectTag, NXOpen.UF.UFConstants.UF_PARAM_STOCK_PART, stockPart)

    Return stockPart

    End Function

     

    '取部件底部余量

    Function GetStockFloor(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim stockfloor As Double

    theUfSession.Param.AskDoubleValue(camObjectTag, NXOpen.UF.UFConstants.UF_PARAM_STOCK_FLOOR, stockfloor)

    Return stockfloor

    End Function

     

    '取主轴转速

    Function GetSpeedValue(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim speedVale As Double

    theUfSession.Param.AskDoubleValue(camObjectTag, NXOpen.UF.UFConstants.UF_PARAM_SPINDLE_RPM, speedVale)

    Return speedVale

    End Function

     

    '取进给速度

    Function GetFeedValue(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim feedValue As Double

    Dim camObject As NXOpen.TaggedObject = NXOpen.Utilities.NXObjectManager.Get(camObjectTag)

    Dim params(0) As NXOpen.CAM.Operation

    params(0) = CType(camObject, NXOpen.CAM.Operation)

    Dim feedsBuilder1 As NXOpen.CAM.ObjectsFeedsBuilder = theSession.Parts.Work.CAMSetup.CreateFeedsBuilder(params)

    feedValue = feedsBuilder1.FeedsBuilder.FeedCutBuilder.Value

    feedsBuilder1.Destroy()

    Return feedValue

    End Function

     

    '取切削时间

    Function GetCutTime(ByVal camObjectTag As NXOpen.Tag) As Double

    Dim cutTime As Double

    theUfSession.Param.AskDoubleValue(camObjectTag, 142, cutTime)

    Return cutTime

    End Function

  • 相关阅读:
    [APUE]第十章 信号
    [APUE]第十一章 线程
    android 音乐播放器中播放模式的设计
    php socket 发送HTTP请求 POST json
    php 扫描url死链接 \033[31m ANSI Linux终端输出带颜色
    Redis学习——Redis持久化之RDB备份方式保存数据
    exit与return的区别
    MQ入门总结(一)消息队列概念和使用场景
    微软放缓.NET动态语言开发计划,徐汇区网站设计 狼人:
    构建高性能ASP.NET站点 网站优化需要考虑的方面,徐汇区网站设计 狼人:
  • 原文地址:https://www.cnblogs.com/bizca/p/5347012.html
Copyright © 2011-2022 走看看