- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I had code that worked in Inv Pro 2016 and now it doesn't in Inv Pro 2018.
It removes the Engineers initials and date approved. It still runs without throwing an error but the date "1/1/1601" shows in the title block.
Public Sub Unsign()
Dim app As Application
Dim Exl As Object
Dim IDW As Document
Dim oPSet As PropertySet
Dim oProp As Property
Set app = ThisApplication
Set IDW = app.ActiveDocument
If Not IDW.PrintManager.Type = 50351616 Then 'if not a .idw throw message
MsgBox ("This macro will only work on .idw files.")
End
End If
Dim IPT As Document
For Each ref In IDW.ReferencedDocuments
If Left(ref.DisplayName, Len(ref.DisplayName) - 4) = Left(IDW.DisplayName, Len(IDW.DisplayName) - 4) Then 'IF THE MODELS PART NUMBER IS THE SAME AS THE DRAWINGS PART #
Set IPT = ref
End If
Next
For Each oPSet In IPT.PropertySets
'Debug.Print (oSet.DisplayName)
For Each oProp In oPSet
With oProp
Debug.Print (" - " & .DisplayName & "(" & .PropId & ") = " & .Expression)
If .DisplayName = "Checked by" Then .Expression = ""
'If .DisplayName = "Date Checked" Then .Value = #1/1/1601#
If .DisplayName = "Date Checked" Then .Expression = "1/1/1601" 'This line is what I'm looking at
If .DisplayName = "Engr Approved by" Then .Expression = ""
'If .DisplayName = "Date Eng Approved" Then .Value = #1/1/1601#
If .DisplayName = "Date Eng Approved" Then .Expression = "1/1/1601"
End With
Next
Next
IDW.Update2
'AutoPrintFunctions.FinalPrintsPETC
'IDW.Close (True)
End SubI found this guy https://forums.autodesk.com/t5/inventor-customization/setting-iproperty-fields-quot-creation-time-qu... at the bottom it makes mention of an error after setting the date to 1/1/1601 but it worked in 2016 so I assumed this was fixed at some point.
As you can see I tried setting .value ILO .expression. I also tried a blank string but I get a "type mismatch".
Any thoughts on how I can make the date show up blank in my title block again?
If I've helped you, please help me by supporting this idea.
Mass Override for Each Model State
Custom Glyph Icon for iMates
Mass Override for Each Model State
Custom Glyph Icon for iMates
Solved! Go to Solution.