Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
C_Haines_ENG
333 Views, 5 Replies

Change iProperty of currently active document

I cannot figure out how to set the description for the currently active document. This script runs through every open part file and generates a description. No matter what combination I put into the iProperties field it only works on the very last part file.

 

Dim oPartDoc As PartDocument
Dim oDoc As Document         
Dim oRefFile As FileDescriptor
oPartDoc = ThisDoc.Document 

For Each oDoc In oPartDoc.AllReferencedDocuments 
	oDocName = IO.Path.GetFileNameWithoutExtension(oDoc.FullFileName)
Next
	
	UHeight = InputBox("Enter Height of Unit in INCHES","Height","")
	UWidth = InputBox("Enter Width of Unit in INCHES","Width","")

For Each oPartDoc In ThisApplication.Documents.VisibleDocuments
	oPartDoc.Activate
	oPartDoc = ThisDoc.Document 
	
		PanelType = InputBox("Enter Panel Type", "Panel Type", PanelType)
		
		
		PanelType = UCase(PanelType)
		
		NewDesc = "75-" & PanelType & " " & oDocName
		
		iProperties.Value(oPartDoc.File.FullFileName, "Custom", "Panel Type") = PanelType
		iProperties.Value(oPartDoc.File.FullFileName, "Project", "Description") = NewDesc