﻿
Dim odrawdoc As DrawingDocument
odrawdoc = ThisApplication.ActiveDocument

customPropertySet = odrawdoc.PropertySets.Item("Inventor User Defined Properties")

Dim PlotDate As Date
PlotDate = Now

Dim PlotTime As String
PlotTime = Now.ToShortTimeString

Dim PlotName As String
PlotName= ThisApplication.UserName

Try
prop = customPropertySet.Item("TiskDatum")
Catch
customPropertySet.Add("", "TiskDatum")
End Try

Try
prop = customPropertySet.Item("TiskCas")
Catch
customPropertySet.Add("", "TiskCas")
End Try

Try
prop = customPropertySet.Item("TiskAutor")
Catch
customPropertySet.Add("", "TiskAutor")
End Try

iProperties.Value("Custom", "TiskDatum") = PlotDate

iProperties.Value("Custom", "TiskCas") = PlotTime

iProperties.Value("Custom", "TiskAutor") = PlotName

InventorVb.DocumentUpdate()

Dim oCtrlDef As ControlDefinition
oCtrlDef = ThisApplication.CommandManager.ControlDefinitions.Item("AppFilePrintCmd")
oCtrlDef.Execute


