
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I want to clean up some custom properties with a externe ilogic rule. I want run it in a iam and than delete some custom properties in the parts. So if they are there in the part, than delete them. But I don't get the code right working. I want delete the custom property "R8_item_nummer"
Here I have some code:
' set a reference to the assembly component definintion.
' This assumes an assembly document is open.
Dim oCompDef As AssemblyComponentDefinition
oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
oCompDef.RepresentationsManager.LevelOfDetailRepresentations("Master").Activate
InventorVb.DocumentUpdate(True)
Try
'Iterate through all of the occurrences
Dim oOccurrence As ComponentOccurrence
For Each oOccurrence In oCompDef.Occurrences
' Set Reference to Part Document
Dim invPart As Document
invPart = oOccurrence.Definition.Document
' Set Reference to Part's iProperies
Dim oPropertySets As PropertySets
oPropertySets = invPart.PropertySets
Dim oValue1 As String
Dim oValue2 As String
Try
oValue1 = iProperties.Value(oOccurrence.Name, "Custom", "R8_omschrijving")
iProperties.Value(oOccurrence.Name, "Project", "Description")=oValue1
Catch
End Try
Try
oValue2 = iProperties.Value(oOccurrence.Name, "Custom", "R8_item_nummer")
iProperties.Value(oOccurrence.Name, "Custom", "R8_GRND_ITEM_NUMMER")=oValue2
If oOccurrence.Name = "R8_item_nummer" Then
'delete the custom iProperty
Else
End If
Catch
End Try
Next
Catch
End Try
Regards,
Jorn
Solved! Go to Solution.