蒹葭苍苍,白露为霜。
所谓伊人,在水一方。

Inventor设计自动判断信息一致性

  Private Sub m_AppEvents_OnActivateDocument(ByVal DocumentObject As Inventor.Document, ByVal BeforeOrAfter As Inventor.EventTimingEnum, ByVal Context As Inventor.NameValueMap, ByRef HandlingCode As Inventor.HandlingCodeEnum) Handles m_AppEvents.OnActivateDocument
        Button3.PerformClick()
        Dim odocument As Document = _invApp.ActiveDocument
        Dim oshortname As String = getshortname(odocument)
        Dim idaihao As String
        Dim imingcheng As String
        If InStr(1, oshortname, " ") > 0 Then
            Do While InStr(oshortname, "  ") '如果有连续的两个空格就替换成一个空格
                oshortname = Replace(oshortname, "  ", " ")
            Loop
            idaihao = oshortname.Split(" ")(0)
            imingcheng = oshortname.Split(" ")(1)
        Else
            imingcheng = oshortname
            idaihao = ""
        End If
        Dim iprodaihao As String = getipro(odocument, "代号", "Inventor User Defined Properties")
        If iprodaihao = idaihao Then
            TextBox1.ForeColor = System.Drawing.Color.Green
        Else
            TextBox1.ForeColor = System.Drawing.Color.Red
        End If

        odocument = Nothing
        oshortname = Nothing
        idaihao = Nothing
        imingcheng = Nothing
        iprodaihao = Nothing
    End Sub

赞(0) 打赏
未经允许不得转载:酷居科技 » Inventor设计自动判断信息一致性

评论 1

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    很厉害的样子

    加气块设备7年前 (2017-08-03)回复

锦瑟无端五十弦,一弦一柱思华年

酷居科技联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏