正在读这篇文章的你,从事着什么工作呢?
也许,你是一名白领,坐在冷气强劲的5A级写字楼,拿着一万出头的工资,每天朝九晚八,带着一身疲惫回家。虽然积蓄不多,却也在一直慢慢增长。
又或许,你是一名应届生,刚刚进入心仪的大公司,虽然奔波在最劳累的第一线岗位,但一想到未来的晋升路径和可能性,就踌躇满志。
也许,你们都在这座城市扎根不久,但都梦想着,通过自己的努力打拼,一步步在公司里站稳脚跟,向上晋升,当上高管,买房,成家,立业。
正在读这篇文章的你,从事着什么工作呢?
也许,你是一名白领,坐在冷气强劲的5A级写字楼,拿着一万出头的工资,每天朝九晚八,带着一身疲惫回家。虽然积蓄不多,却也在一直慢慢增长。
又或许,你是一名应届生,刚刚进入心仪的大公司,虽然奔波在最劳累的第一线岗位,但一想到未来的晋升路径和可能性,就踌躇满志。
也许,你们都在这座城市扎根不久,但都梦想着,通过自己的努力打拼,一步步在公司里站稳脚跟,向上晋升,当上高管,买房,成家,立业。
可用ilogic直接保存运行,代码如下:
Dim oDoc As Document = ThisApplication.ActiveDocument
If oDoc.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then Exit Sub
Dim oADO As Inventor.ComponentOccurrences = oDoc.ComponentDefinition.Occurrences
Dim ES As String = vbNullString
For Each aDoc As Document In oDoc.AllReferencedDocuments
Dim sFN As String = aDoc.FullFileName
Dim Amount As Integer = oADO.AllReferencedOccurrences(aDoc).Count
Dim oPropsets As PropertySets = aDoc.PropertySets
Dim oPropSet As PropertySet = oPropsets.Item("{32853F0F-3444-11D1-9E93-0060B03C1CA6}")
Dim PN As String = oPropSet("Part Number").Expression
If ES <> vbNullString Then ES += vbNewLine
ES += PN & " " & CStr(Amount)
Next
MsgBox(ES)
Public Sub WorkPointAtMassCenter()
Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
' 获取重心.
Dim oCenterOfMass As Point
Set oCenterOfMass = oDoc.ComponentDefinition.MassProperties.CenterOfMass
On Error Resume Next
Dim oWorkPoint As WorkPoint
Set oWorkPoint = oDoc.ComponentDefinition.WorkPoints.Item("Center Of Mass")
If Err.Number = 0 Then
Dim oFixedDef As FixedWorkPointDef
Set oFixedDef = oWorkPoint.Definition
oFixedDef.Point = oCenterOfMass
oDoc.Update
Else
Set oWorkPoint = oDoc.ComponentDefinition.WorkPoints.AddFixed(oCenterOfMass)
oWorkPoint.name = "Center Of Mass"
End If
End Sub
最近比较忙,忙着处理非设计事务,不过偶尔会有打开工程图查看相关尺寸的需求。通常都是打开一个大型装配体,然后在装配体里面层层往下打开相关零件,然后再打开工程图。感觉这样很繁琐。
脑海中突然想结束这样的一个繁琐的流程。于是在处理其它事情的时候,潜意识里已经在构造相关方法。
然后想了一下,其实蛮简单的一个过程。
基本功能:首先,定位在顶级装配上,然后选中对应的零件或者零部件,然后点击一个按钮即可打开工程图。
逻辑:按钮内要包含相关程序,首先得判断指定零件或者零部件是否存在对应的工程图,如果存在,那么打开。否则提醒用户,不存在相应工程图。
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