- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Thanks Chandra.
The code you posted works because it obtains the date and time stamp before the base component is suppressed.
The problem I have is that I wish to check the base component's (STRUCTURE ASSEMBLY.iam) Save Date & Time Stamp custom iproperty before it is unsuppressed in the STRUCTURE ASSEMBLY (SHRINKWRAPPED).ipt file.
This is to determine whether the base component actually needs to be unsuppressed and updated or not.
To give some context as to why I'm trying to do this, I have multiple large sub-assemblies with large amounts of iLogic code set to run after opening document.
So I've shrinkwrapped these sub-assemblies for use in a full General Arrangement model but wish to ensure all the iLogic code in the sub-assemblies don't trigger automatically unless it is necessary.
Hence this is why the link to the base component is always suppressed in the shrinkwrap unless it is identified as needing an update.
Essentially I need to reference the suppressed base component's Save Date & Time Stamp custom iproperty without opening or unsuppressing it.
I've been trying various pieces of code but can't seem to get it to work.
I think I might be getting closer with this code but keep getting the error:
Could not find file 'C:\Users\kwalker\AppData\Local\Temp\c2uo3tfu.dll'.
Sub Main()
shrinkwrapStamp = iProperties.Value("Custom", "SHRINKWRAP SAVE DATE & TIME STAMP")
Dim baseComponentFilePath As String
baseComponentFilePath = ThisDoc.Path + "\STRUCTURE ASSEMBLY.iam"
Dim baseComponentFile As Document
baseComponentFile = baseComponentFilePath
Dim invDoc As Document
invDoc = ThisApplication.Document.baseComponentFile
' Get the user defined property set.
Dim invCustomPropertySet As PropertySet
invCustomPropertySet = invDoc.PropertySets.Item("Inventor User Defined Properties")
' Get the part number property.
Dim baseComponentStamp As Properties
baseComponentStamp = invCustomPropertySet.Item("STRUCTURE SAVE DATE & TIME STAMP")
'MessageBox.Show(baseComponentStamp, "Title")
If shrinkwrapStamp <> baseComponentStamp Then
iLogicVb.RunRule("iLogic Rules")
Else
'OTHERWISE Do Nothing And End CODE
End If
End Sub
Thank you for your help.
Regards,
Kurt.