Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
chandra.shekar.g
in reply to: kwalker1

@kwalker1,

 

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