Question: Is there any Inventor API to enable “Copy Model iProperty Settings” in a Drawing Document as shown in below?
Answer: Unfortunately, there is no direct Inventor API to enable “Copy Model iProperties Settings” in Drawing Document. But below iLogic code helps to copy iProperties from Model Document to Drawing Document.
Dim oPropList As ArrayList = New ArrayList()
oPropList.Add("AUTHOR")
oPropList.Add("AUTHORITY")
oPropList.Add("CATEGORY")
oPropList.Add("CHECKED BY")
oPropList.Add("CHECKED DATE")
oPropList.Add("COMMENTS")
oPropList.Add("COMPANY")
oPropList.Add("COST CENTER")
oPropList.Add("CREATION DATE")
oPropList.Add("DESCRIPTION")
oPropList.Add("DESIGN STATE")
oPropList.Add("DESIGNER")
oPropList.Add("ENGR APPROVAL DATE")
oPropList.Add("ENGR APPROVED BY")
oPropList.Add("ENGINEER")
oPropList.Add("ESTIMATED COST")
oPropList.Add("KEYWORDS")
oPropList.Add("MANAGER")
oPropList.Add("MFG APPROVED BY")
oPropList.Add("MFG APPROVED DATE")
oPropList.Add("PART NUMBER")
oPropList.Add("PROJECT")
oPropList.Add("REVISION NUMBER")
oPropList.Add("STATUS")
oPropList.Add("STOCK NUMBER")
oPropList.Add("SUBJECT")
oPropList.Add("TITLE")
oPropList.Add("VENDOR")
oPropList.Add("WEBLINK")sel_iProperty = InputListBox("CHOOSE iPROPERTY FROM ABOVE LIST", oPropList, oPropList.Item(0), "iPROPERTY SELECTION", "LIST OF iPROPERTY")
oRefDoc = ThisDrawing.ModelDocument
Dim oPropValue As StringSelect Case sel_iProperty
Case "AUTHOR"
oPropValue = oRefDoc.PropertySets("Summary Information").Item("Author").value
iProperties.Value("Summary", "Author") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")Case "AUTHORITY"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Authority").value
iProperties.Value("Project", "Authority") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "CATEGORY"
oPropValue = oRefDoc.PropertySets("Document Summary Information").Item("Category").value
iProperties.Value("Summary", "Category") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "CHECKED BY"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Checked By").value
iProperties.Value("Project", "Checked By") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "CHECKED DATE"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Date Checked").value
iProperties.Value("Project", "Date Checked") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "COMMENTS"
oPropValue = oRefDoc.PropertySets("Summary Information").Item("Comments").value
iProperties.Value("Summary", "Comments") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "COMPANY"
oPropValue = oRefDoc.PropertySets("Document Summary Information").Item("Company").value
iProperties.Value("Summary", "Company") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "COST CENTER"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Cost Center").value
iProperties.Value("Project", "Cost Center") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "CREATION DATE"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Creation Time").value
iProperties.Value("Project", "Creation Time") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "DESCRIPTION"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Description").value
iProperties.Value("Project", "Description") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "DESIGN STATE"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Design Status").value
iProperties.Value("Project", "Design Status") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "DESIGNER"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Designer").value
iProperties.Value("Project", "Designer") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "ENGR APPROVAL DATE"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Engr Date Approved").value
iProperties.Value("Project", "Engr Date Approved") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "ENGR APPROVED BY"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Engr Approved By").value
iProperties.Value("Project", "Engr Approved By") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "ENGINEER"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Engineer").value
iProperties.Value("Project", "Engineer") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "ESTIMATED COST"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Cost").value
iProperties.Value("Project", "Cost") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "KEYWORDS"
oPropValue = oRefDoc.PropertySets("Summary Information").Item("Keywords").value
iProperties.Value("Summary", "Keywords") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "MANAGER"
oPropValue = oRefDoc.PropertySets("Document Summary Information").Item("Manager").value
iProperties.Value("Summary", "Manager") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "MFG APPROVED BY"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Mfg Approved By").value
iProperties.Value("Project", "Mfg Approved By") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "MFG APPROVED DATE"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Mfg Date Approved").value
iProperties.Value("Project", "Mfg Date Approved") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "PART NUMBER"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Part Number").value
iProperties.Value("Project", "Part Number") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "PROJECT"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Project").value
iProperties.Value("Project", "Project") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "REVISION NUMBER"
oPropValue = oRefDoc.PropertySets("Summary Information").Item("Revision Number").value
iProperties.Value("Summary", "Revision Number") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "STATUS"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("User Status").value
iProperties.Value("Project", "User Status") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "STOCK NUMBER"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Stock Number").value
iProperties.Value("Project", "Stock Number") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "SUBJECT"
oPropValue = oRefDoc.PropertySets("Summary Information").Item("Subject").value
iProperties.Value("Summary", "Subject") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "TITLE"
oPropValue = oRefDoc.PropertySets("Summary Information").Item("Title").value
iProperties.Value("Summary", "Title") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "VENDOR"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Vendor").value
iProperties.Value("Project", "Vendor") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
Case "WEBLINK"
oPropValue = oRefDoc.PropertySets("Design Tracking Properties").Item("Catalog Web Link").value
iProperties.Value("Project", "Catalog Web Link") = oPropValue
MessageBox.Show(sel_iProperty + " iProperty updated successfully with value : " + oPropValue, "iProperty")
End Select
On running above iLogic code, a Input list box appears for selection of iProperty as shown in below image.
After selecting iProperty from list and clicking “OK” button, respective value of iProperty from Model document will be copied to Drawing document.