Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to figure out a method of adding a new iProperty to a virtual part AFTER it has already been created in an assembly.
The following code runs without errors but it unsuccessfully adds the new iProperty. I tried going line by line to debug but I cannot figure out why when looping through virtual parts it doesn't actually change the iProperty but still displays the correct name of the virtual part.
Dim oAssDoc As AssemblyDocument = ThisApplication.ActiveDocument Dim oAssDef As AssemblyComponentDefinition = oAssDoc.ComponentDefinition Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAssDef.Occurrences If TypeOf oOccurrence.Definition Is VirtualComponentDefinition Then ' Define Comp Def Dim oVirt As VirtualComponentDefinition oVirt = oOccurrence.Definition 'oVirt.PropertySets.Add("Priority", "1") iProperties.Value(oVirt.DisplayName, "Custom", "Priority") = 1 End If Next
^ This is what the custom panel looks like for iProperty. Eventually I want to expand the code to detect the routing of a virtual part and then assign an associated priority. As it stands, nothing I have tried with accessing the iProperties for the virtual part has worked.
Solved! Go to Solution.