Custom iProperties not updating in Title Block

Custom iProperties not updating in Title Block

shizahkhalid
Contributor Contributor
363 Views
2 Replies
Message 1 of 3

Custom iProperties not updating in Title Block

shizahkhalid
Contributor
Contributor

Hello,

I am trying to add the custom iProperties of the drawing document shown below to the Title Block using the below code. The iProperties are added by user input, and they update for the drawing document, but not in the Title Block (the respective fields remain empty).

shizahkhalid_0-1722337809645.png

 

Sub Main() 
    Dim oDrawDoc As Document
    oDrawDoc = ThisApplication.ActiveDocument

    'customPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")
    'Promt the user for the value of a variable
    title01 = InputBox("Please Enter the Project Title:", "Custom Property Input Box", "The Default Entry")
    title02 = InputBox("Please Enter the Project Sub-title:", "Custom Property Input Box", "The Default Entry")
    drawnBy = InputBox("Drawn by:", "Custom Property Input Box", "The Default Entry")
    checkedBy = InputBox("Checked by:", "Custom Property Input Box", "The Default Entry")
    drawnDate = InputBox("Drawn Date (Format: dd/mm/yy):", "Custom Property Input Box", "The Default Entry")
    checkedDate = InputBox("Checked Date (Format: dd/mm/yy):", "Custom Property Input Box", "The Default Entry")

    'assign the value of that variable to a custom property
    iProperties.Value("Custom", "ProjectName01") = title01
    iProperties.Value("Custom", "ProjectName02") = title02
    iProperties.Value("Custom", "DrawnBy") = drawnBy
    iProperties.Value("Custom", "CheckedBy") = checkedBy
    iProperties.Value("Custom", "DrawnDate") = drawnDate
    iProperties.Value("Custom", "CheckedDate") = checkedDate
	
	Dim oSheet As Sheet
    For Each oSheet In oDrawDoc.Sheets
        oSheet.Update
    Next
End Sub

 

In my title block configuration, for the custom iproperties, I chose primary or attached model in Custom iProperties:

shizahkhalid_1-1722338065582.png

 

What could be the issue here? Thank you for reading, and I would appreciate any guidance.

 

 

0 Likes
Accepted solutions (1)
364 Views
2 Replies
Replies (2)
Message 2 of 3

m_baczewski
Advocate
Advocate
Accepted solution
Hi,

It seems that you need to set currentDrawing as the source, because it's in this document where you are changing user parameters.
Message 3 of 3

shizahkhalid
Contributor
Contributor

that worked, thanks!

0 Likes