Invent
26.03.2014, 09:38
Prosím o radu.
V Inventoru 2013 jsem měl ve výkresu makro, které při uložení výkresu automaticky přepsalo datum změny ve výkrese.Po přechodu na Inventor 2014 mi toto makro přestalo fungovat, přitom je ve výkrese (novém i starém) stále obsaženo. Nevíte kde je problém a jak jej vyřešit aby makro znofu fungovalo?Zde je text zmíněného makra.Public Sub AutoSave()Call AddSysDateTimeEnd SubPublic Sub AddSysDateTime()On Error Resume Next'Check if the active document is a DrawingIf ThisApplication.ActiveDocumentType = kDrawingDocumentObject Then'Add a custom property "SysDate" with system dateSet oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")'As a workaround the property must be delete because it can not be changedoPropSet.Item("SysDate").DeleteCall oPropSet.Add(Format(Date, "d.m.yyyy"), "SysDate")'Add a custom property "SysTime" with system timeSet oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")'As a workaround the property must be delete because it can not be changedoPropSet.Item("SysTime").DeleteCall oPropSet.Add(Format(Time, "h:mmam/pm"), "SysTime")'Still having some problems that the last property does not update correctCall RefreshPropertiesEnd IfEnd SubPrivate Sub RefreshProperties()Set oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")Call oPropSet.Add("", "MyDummy")oPropSet.Item("MyDummy").DeleteEnd Sub
V Inventoru 2013 jsem měl ve výkresu makro, které při uložení výkresu automaticky přepsalo datum změny ve výkrese.Po přechodu na Inventor 2014 mi toto makro přestalo fungovat, přitom je ve výkrese (novém i starém) stále obsaženo. Nevíte kde je problém a jak jej vyřešit aby makro znofu fungovalo?Zde je text zmíněného makra.Public Sub AutoSave()Call AddSysDateTimeEnd SubPublic Sub AddSysDateTime()On Error Resume Next'Check if the active document is a DrawingIf ThisApplication.ActiveDocumentType = kDrawingDocumentObject Then'Add a custom property "SysDate" with system dateSet oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")'As a workaround the property must be delete because it can not be changedoPropSet.Item("SysDate").DeleteCall oPropSet.Add(Format(Date, "d.m.yyyy"), "SysDate")'Add a custom property "SysTime" with system timeSet oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")'As a workaround the property must be delete because it can not be changedoPropSet.Item("SysTime").DeleteCall oPropSet.Add(Format(Time, "h:mmam/pm"), "SysTime")'Still having some problems that the last property does not update correctCall RefreshPropertiesEnd IfEnd SubPrivate Sub RefreshProperties()Set oPropSet = ThisApplication.ActiveDocument.PropertySets("{D5CDD505-2E9C-101B-9397-08002B2CF9AE}")Call oPropSet.Add("", "MyDummy")oPropSet.Item("MyDummy").DeleteEnd Sub