Looking for a way to delete predefined custom parameters with a rule.
I have Custom Parameters called:
"Ilgis"
"Storis"
"Plotis"
which i need to delete.
This rule can be used as a base, but instead of deleting all props, it could delete predefined set?
On Error Resume Next
'define custom property collection
oCustomPropertySet = ThisDoc.Document.PropertySets.Item("Inventor User Defined Properties")
'look at each property in the collection
For Each oCustProp In oCustomPropertySet
'delete the custom iProperty
oCustProp.Delete
Next
Solved! Go to Solution.
Solved by JelteDeJong. Go to Solution.
Does this work for you?
Dim doc As Document = ThisDoc.Document Dim predefinedSet As New List(Of String) predefinedSet.Add("Ilgis") predefinedSet.Add("Storis") predefinedSet.Add("Plotis") Dim oCustomPropertySet As PropertySet = doc.PropertySets.Item("Inventor User Defined Properties") For Each oCustProp As [Property] In oCustomPropertySet If (predefinedSet.Contains(oCustProp.Name)) Then oCustProp.Delete() End If Next
Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
Blog: hjalte.nl - github.com
Can't find what you're looking for? Ask the community or share your knowledge.