last printed date

last printed date

rjkdk
Enthusiast Enthusiast
399 Views
2 Replies
Message 1 of 3

last printed date

rjkdk
Enthusiast
Enthusiast

I would like to be able to add a notice "last printed on DATE " on the margin  of my inventor .idw prints.

Any ideas?

0 Likes
400 Views
2 Replies
Replies (2)
Message 2 of 3

AlexKorzun
Autodesk
Autodesk

You might consider this:

  1. Create external rule PrintDateRule with the code similar to:
    Dim text As String = System.DateTime.Now.Date.ToString("d")
    Dim doc As DrawingDocument = ThisDrawing.Document
    Dim customProperties As PropertySet = doc.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")
    Dim printDate As [Property] = Nothing
    Try
    	printDate = customProperties("PrintedOn") 
    Catch
    End Try
    If (printDate Is Nothing) Then 
    	printDate = customProperties.Add(text, "PrintedOn")
    Else
    	printDate.Value = text
    End If​

    That will create custom iProperty PrintedOn:
    AlexKorzun_0-1615502603743.png

  2.  Ensure this rule is run when you open the drawing document:
    AlexKorzun_1-1615502731559.png
  3. Edit TitleBlock(s) and add textbox. Assign the PrintentOn value to it :
    AlexKorzun_2-1615504849596.png
  4. Save everything. Now, this drawing will update PrintedOn string when opened:
    AlexKorzun_3-1615504963436.png

 

Thank you,




Alex Korzun
Inventor-Revit Interop / Inventor-Fusion Interop / Inventor ETO
Autodesk, Inc.

Message 3 of 3

WCrihfield
Mentor
Mentor

Great job documenting that process @AlexKorzun .

I just wanted to add one more little thing in there.  Since @rjkdk mentioned wanting to put this note in the 'margin' of the drawing, I would alternatively suggest editing the 'Border' (instead of the 'Title Block') and inserting that text block there, maybe just barely outside the lines, if there is room for it.

This could either be set-up once manually within each of the drawing template documents, or could be done completely by code, if needing to apply it for older drawing documents.  If done by code, the code could either find and edit the sheet's existing border sketch, or just have the note be independent of the border or title block, and simply overlay them at a certain predefined position, where it isn't covering anything important.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes