- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I'm looking to copy an iProperty from my top level assembly and send it down to the constituent part files as a parameter so I can use it to engrave the assembly part number. The code I have attempts to naively send it to every part, but it would be better to filter down to parts that begin with "T-" or "M-". I don't necessarily need the parameter to be created in every file, since it's typically only engraved on one piece, but if it were filtered, then it wouldn't hurt anything.
When I run my code, I successfully get the debug logs for the correct assembly part number to push and for each occurrence in the assembly, but the part that I have the parameter in does not receive the updated value. Any help appreciated.
Thanks!
Dim oDoc As AssemblyDocument
oDoc = ThisDoc.Document
Dim oOccs As ComponentOccurrences = oDoc.ComponentDefinition.Occurrences
Dim oOcc As ComponentOccurrence
Parameter.Quiet = True 'Don't show errors when there's no parameter to set'
iLogicVb.UpdateWhenDone = True 'Update the assembly when done'
Dim PartNumber As String
PartNumber = iProperties.Value("Project", "Part Number") 'Pulls Part Number from iProperties as variable PartNumber'
Logger.Debug("Part Number {0}", PartNumber) 'Debug is PartNumber set correctly'
For Each oOcc In oOccs
Parameter(oOcc, "PartNum") = PartNumber
Logger.Debug("Attempting to set value to {0}",oOcc.Name)
Next
Solved! Go to Solution.