Check or UnCheck iProperties “Date Created” and “Date Checked” example

By Wayne Brill

It is not obvious how to add or remove a check to an iProperty such as Creation Date:

image

 

In the VBA watch window you will see that when the “Date Created” iProperty is not checked the Expression property of the iProperty is not a valid date. When it is checked it has a valid date. If you give the iProperty Expression a valid date value it will be checked. Using a date value of “1601, 1, 1” removes the checkmark.  

Here is a VBA example:

<

p style=”font-size: 10pt;font-family: arial;background: #eeeeee;color: black;line-height: 140%”>Public Sub iProperties_Test()
    ‘ Get the active document.
    Dim invDoc As Document
    Set invDoc = ThisApplication.ActiveDocument
   
    ‘ Get the design tracking property set.
    Dim invDesignInfo As PropertySet
    Set invDesignInfo = invDoc.PropertySets.Item(“Design Tracking Properties”)
       
    Dim iProp As Property
    For Each iProp In invDesignInfo
        ‘If iProp.Name = “Date Checked” Then
        If iProp.DisplayName = “Date Created” Then
            ‘Property is unchecked with this
           ‘ iProp.Expression = “1601, 1, 1”
            ‘Property is checked with this
            iProp.Expression = #7/22/2016#
           
            Exit For
        End If
    Next iProp
   
End Sub


Comments

One response to “Check or UnCheck iProperties “Date Created” and “Date Checked” example”

  1. Bram Ruijter Avatar
    Bram Ruijter

    I’m pretty new in ilogic, but witch parameter is the “Date Created” checked parameter?
    Please do not tangle it in all sorts of good practice rules. It makes reading code voor noobs realy hard.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading