Apply different changes to select parts in an assembly

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm VERY new to ilogic so I'm on a steep learning curve right now. I'm hoping the answer to this is something easy!
I have an Excel file that generates parameters that drives the geometry of parts called "Hook-(thickness)-V0.ipt" and "Straight-(thickness)-V0.ipt"
I currently have a rule (which I didn't originally write, just edited) in each of the part files that changes the PART NUMBER based on the parameter the spreadsheet gives it for thickness (HLt or SLt). The FILE NAME of the original does not change, but a new part is created with the FILE NAME and PART NUMBER being the new values.
InventorVb.DocumentUpdate() newname = ThisDoc.FileName(False) posx = InStr (newname, "(") If posx >0 Then newname = Left(newname,posx-1) Parameter.Quiet = True iProperties.Value("Project", "Part Number") = newname & Parameter("SLt") & "-V0" 'MsgBox("Current Part Number = " & iProperties.Value("Project", "Part Number"))FileToSave = ThisDoc.Path & "\" & iProperties.Value("Project", "Part Number") & ".ipt" If IO.File.Exists(FileToSave) Then 'MsgBox("Member already exists")Else MsgBox("New part file being created : " & FileToSave) ThisDoc.Document.SaveAs(FileToSave , True) End If
For example:
The part is "Hook-(thickness)-V0.ipt." The Excel file passes a thickness parameter of 0.105 to this part. When I rule my part-level rule, a NEW file is created with the FILE NAME reading "Hook-0.105-V0.ipt" and the PART NUMBER reading "Hook-0.105-V0" if it didn't already exist. However, the part "Hook-(thickness)-V0.ipt." FILE NAME remains unchanged but the PART NUMBER is changed to "Hook-0.105-V0"
Multiple occurrences of each "Hook-(thickness)-V0.ipt." and "Straight-(thickness)-V0.ipt" are in an assembly. However, I need the BOM quantity for each of these parts to be overriden by values provided by the Excel spreadsheet (bomHL and bomSL). This is the current rule I have:
ThisBOM.OverrideQuantity("Model Data","Hook-" &HLt & "-V0",bomHL) ThisBOM.OverrideQuantity("Model Data","Straight-"&SLt&"-V0",bomSL)
I make changes to the spreadsheet, which changes parameters in the assembly and the parts. However, because I haven't ran the rules in each part to assign it a new part number (based on the values for HLt or SLt) the BOM qty override can't find the part.
How can I accomplish the PART NUMBER changes for every occurrence of each of these parts in the assembly without having to seperately open each part first, and run the part-level rule?
Thanks!