Ðề: Những Câu Hỏi Về Inventor
Vấn đề là 1 bản drawing mình đưa cho công nhân có thể in 2 or 3 lần, nếu họ nhìn thấy 2 bản có ký hiệu giống nhau, sẽ ko biết bản nào là mới nhất, nên mỗi khi mình sửa xong, in ra đều phải ghi tay ngày tháng hiện tại để họ phân biệt ->mất time.
Chào bạn,
Bạn Add Macro này vào phần "ThisDocument"
Public Sub AutoSave()
Call AddSysDateTime
End Sub
Public Sub AddSysDateTime()
On Error Resume Next
'Check if the active document is a Drawing
If ThisApplication.ActiveDocumentType = kDrawingDocumentObject Then
'Add a custom property "SysDate" with system date
Set oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
'As a workaround the property must be delete because it can not be changed
oPropSet.Item("SysDate").Delete
Call oPropSet.Add(Format(Date, "dd/mm/yy"), "SysDate")
'Add a custom property "SysTime" with system time
Set oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
'As a workaround the property must be delete because it can not be changed
oPropSet.Item("SysTime").Delete
Call oPropSet.Add(Format(Time, "hh:mm"), "SysTime")
'Still having some problems that the last property does not update correct
Call RefreshProperties
End If
End Sub
Private Sub RefreshProperties()
Set oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
Call oPropSet.Add("", "MyDummy")
oPropSet.Item("MyDummy").Delete
End Sub
Vào Custom Properties của Drawing add thêm SysDate và Systime
Link nó vào nơi nào mà bạn cần trên bản vẽ.
Chúc bạn thành công. Do giới hạn thời gian nên mình không chỉ kỹ được.
Nếu không làm được thì gửi file template cho mình hoặc liên hệ YM:mars_duc_orions mình sẽ giúp cho
Chào bạn
Đức