Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I need to make a ilogic code that only runs if the Last Modified Date is aften "20-03-2018 10:41:47". how do i do that ?
Solved! Go to Solution.
I need to make a ilogic code that only runs if the Last Modified Date is aften "20-03-2018 10:41:47". how do i do that ?
Solved! Go to Solution.
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Of all IPT or IAM files.
What i need it to add a custom properties to all 3d inventor files .. but only to thoes that are form about 3 Mount ago or later... I want inter to stop asking for the porperties when i open a drawing older then that date i pick
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
This will do what you need I think:
Private Sub Main() Dim fromDate As Variant fromDate = "01-Jan-11 00:00:00" Dim toDate As Variant toDate = "01-Jan-10 23:59:00" MsgBox ("Line 1 : " & DateDiff("yyyy", fromDate, toDate)) MsgBox ("Line 2 : " & DateDiff("q", fromDate, toDate)) MsgBox ("Line 3 : " & DateDiff("m", fromDate, toDate)) MsgBox ("Line 4 : " & DateDiff("y", fromDate, toDate)) MsgBox ("Line 5 : " & DateDiff("d", fromDate, toDate)) MsgBox ("Line 6 : " & DateDiff("w", fromDate, toDate)) MsgBox ("Line 7 : " & DateDiff("ww", fromDate, toDate)) MsgBox ("Line 8 : " & DateDiff("h", fromDate, toDate)) MsgBox ("Line 9 : " & DateDiff("n", fromDate, toDate)) MsgBox ("Line 10 : " & DateDiff("s", fromDate, toDate)) End Sub
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
I am not sure how to use that ...
I need somthing like this
if ( lastmodifieddate > (2018, 3, 20, 22, 45, 0)) Then
my code
end if.
how would that look like with ?
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
This is a correct date format:
Private Sub Main() Dim fromDate As Variant fromDate = "2018-3-20 22:45:0" Dim toDate As Variant toDate = "2018-3-20 22:45:0" MsgBox ("Line 1 : " & DateDiff("yyyy", fromDate, toDate)) MsgBox ("Line 2 : " & DateDiff("q", fromDate, toDate)) MsgBox ("Line 3 : " & DateDiff("m", fromDate, toDate)) MsgBox ("Line 4 : " & DateDiff("y", fromDate, toDate)) MsgBox ("Line 5 : " & DateDiff("d", fromDate, toDate)) MsgBox ("Line 6 : " & DateDiff("w", fromDate, toDate)) MsgBox ("Line 7 : " & DateDiff("ww", fromDate, toDate)) MsgBox ("Line 8 : " & DateDiff("h", fromDate, toDate)) MsgBox ("Line 9 : " & DateDiff("n", fromDate, toDate)) MsgBox ("Line 10 : " & DateDiff("s", fromDate, toDate)) End Sub
Regards,
Autodesk Software: Inventor Professional 2018 | Vault Professional 2018 | Autocad Mechanical 2018
Programming Skills: Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Dimension Component! | Partlist Export! | Derive I-properties! | Vault Prompts Via API! | Vault Handbook/Manual!
Drawing Toggle Sheets! | Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
Regards,
Arthur Knoors
Autodesk Affiliations & Links:
Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!
! For administrative reasons, please mark a "Solution as solved" when the issue is solved !
I use this code and if the runScript Boolean is true it will run the rest of the ilogic code 🙂
I use this code and if the runScript Boolean is true it will run the rest of the ilogic code 🙂 Sub Main() '------------------------Read Me ---------------------------------------- ' Tjekker om der kommer surface på Sheet Metal, Part, Assembly og welded '------------------------Read Me --------------------------------------- Dim strFileName As String Dim oFS As Object Dim oDate1 As DateTime Dim oDate2 As DateTime Dim runScript As Boolean = True strFileName = ThisDoc.Document.FullFileName If strFileName IsNot "" oFS = CreateObject("Scripting.FileSystemObject") 'Dato for hvornår den sidste er blevet ændret oDate1 = oFS.GetFile(strFileName).DateLastModified 'Dato for hvornår man skal sætte surface på oDate2 = New DateTime (2018, 3, 20, 22, 45, 0) End If If oDate1 < oDate2 Then runScript = False debug("Filen er ældre og vil derfor ikke få surface på") 'MessageBox.Show("old" & oDate1, "Title") Else runScript = True debug("Filen er nyrer og skal derfor få surface på") 'MessageBox.Show("Ny" & oDate1 &">" &"20-03-2018 10:41:47" , "Title") End If
Try below iLogic code to compare dates.
Sub Main() Dim strFileName As String = ThisDoc.Document.FullFileName Dim oDate1 As Date Dim oFs As Object oFs = CreateObject("Scripting.FileSystemObject") oDate1 = oFs.GetFile(strFileName).DateLastModified MsgBox(oDate1, 0, "File Access Info") Dim oDate2 As Date = New Date(2018, 3, 20, 22, 45, 0) MsgBox(oDate2, 0, "File Access Info") Dim result As Integer = DateTime.Compare(oDate1, oDate2) Dim relationship As String If result < 0 Then relationship = "is earlier than" ElseIf result = 0 Then relationship = "is the same time as" Else relationship = "is later than" End If MsgBox(relationship, 0, "File Status Info") End Sub
Please feel free to contact if there is any queries.
If solves problem, click on "Accept as solution" / give a "Like".
Thanks and regards,