11-23-2018
01:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-23-2018
01:08 AM
Try below iLogic rule to update custom iProperty from ShrinkWrap component to part document.
Sub Main()
Dim oShrinkwrap As PartDocument
oShrinkwrap = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition
oDef = oShrinkwrap.ComponentDefinition
Dim oShrinkComp As ShrinkwrapComponent
For Each oShrinkComp In oDef.ReferenceComponents.ShrinkwrapComponents
oShrinkComp.SuppressLinkToFile = False
iLogicVb.UpdateWhenDone = True
Next
For Each oShrinkComp In oDef.ReferenceComponents.ShrinkwrapComponents
Dim oReferDoc As Document
oReferDoc = oShrinkComp.ReferencedDocumentDescriptor.ReferencedDocument
Dim oPropValue As String
oPropValue = oReferDoc.PropertySets.Item(4).Item("STRUCTURE SAVE DATE & TIME STAMP").Value
oShrinkComp.SuppressLinkToFile = True
iProperties.Value("Custom", "SHRINKWRAP SAVE DATE & TIME STAMP") = oPropValue
Next
'UPDATE SHRINKWRAP SAVE Date & TIME STAMP (CODE TEST 1)
'UPDATE SHRINKWRAP SAVE DATE & TIME STAMP (CODE TEST 2)
'Dim baseComponentFilePath As String
'baseComponentFilePath = ThisDoc.Path + "\STRUCTURE ASSEMBLY.iam"
'iProperties.Value("Custom", "SHRINKWRAP SAVE DATE & TIME STAMP") = iProperties.Value(baseComponentFilePath, "Custom", "STRUCTURE SAVE DATE & TIME STAMP")
End Sub
Thanks and regards,
CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network
