- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have an Assembly which have iLogic rules.
If I make a Copy Design whit Vault and add a suffix or a prefix to the original name the rules are dont run anymore.
Can I add a rule which update the rules if name is change?
Or how can I fix it?
Thank You very much...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, welcome to the forum, you should open the assembly and in your rules you should not put the name to identify a component in an assembly, because the name is what will change later. For instance, suppose you have a rule like this (they compared it recently in another forum thread)
Parameter("Flange_DIN.ipt","DN") = DN_DIN
you should identify the component in another way, for example, through the occurrence item.
Then I leave you a code so you can identify the item that defines your component in the assembly, each item has a component
Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Dim oDef As AssemblyComponentDefinition oDef = oDoc.ComponentDefinition For i As Integer = 2 To oDef.Occurrences.Count Dim oOcc As ComponentOccurrence = oDef.Occurrences.Item(i) MessageBox.Show("Item Number: " & i & vbCrLf & "Occurrence Name: " & oOcc.Name ) Next
For instance, if for your part "Flange_DIN.ipt" you find that it corresponds to item 3 . you should change the line
Parameter("Flange_DIN.ipt","DN") = DN_DIN
by the lines ( you must completely define the syntax oDef at the beginning of the rule)
Dim oFlangeDIN As ComponentOccurrence = oDef.Occurrences.Item(3) Parameter(oFlangeDIN.name,"DN") = DN_DIN
If you identify each component through the item, you can rename them and the rules will continue to work correctly.
I hope it will help you solve your problem
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I don´t understand exactly your explanation, and where are they com from..:(
my rules are like this.
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 30822 StartFragment: 314 EndFragment: 30790 StartSelection: 314 EndSelection: 314
If CC50_centricoate= 1 Then Parameter("CC50 centricoate FP foundation:1", "foundation")=1 End If If Powder_feeder_Left=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder L:1", "Powder_feeder_Left", 0, 1) Parameter("CC50 powder feeder L:1", "Powder_feeder_Left") = 1 ul End If If Powder_feeder_Left=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder L:1", "Powder_feeder_Left", 0, 1) Parameter("CC50 powder feeder L:1", "Powder_feeder_Left") = 0 ul End If If Powder_feeder_Left_Fantom=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom", 0, 1) Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom") = 1 ul End If If Powder_feeder_Left_Fantom=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom", 0, 1) Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom") = 0 ul End If If Powder_feeder_Right=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder R:1", "Powder_feeder_Right", 0, 1) Parameter("CC50 powder feeder R:1", "Powder_feeder_Right") = 1 ul End If If Powder_feeder_Right=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder R:1", "Powder_feeder_Right", 0, 1) Parameter("CC50 powder feeder R:1", "Powder_feeder_Right") =0 ul End If If Powder_feeder_Right_Fantom=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom", 0, 1) Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom") = 1 ul End If If Powder_feeder_Right_Fantom=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom", 0, 1) Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom") = 0 ul End If If Door_Fantom=1 ul Then MultiValue.SetListInComponent("CC50 Door:1", "Door_Fantom", 0, 1) Parameter("CC50 Door:1", "Door_Fantom") = 1 ul End If If Door_Fantom=0 ul Then MultiValue.SetListInComponent("CC50 Door:1", "Door_Fantom", 0, 1) Parameter("CC50 Door:1", "Door_Fantom") = 0 ul End If If Powder_feeder_Left=0 ul Then Powder_feeder_Left_Fantom = 0 ul Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom")= 0 ul ElseIf Powder_feeder_Left_Fantom = 1 ul Then Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom")= 1 ul End If If Powder_feeder_Right=0 ul Then Powder_feeder_Right_Fantom = 0 ul Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom")= 0 ul ElseIf Powder_feeder_Right_Fantom = 1 ul Then Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom")= 1 ul End If
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
What I was trying to tell you is that you must change all the names that I have crossed out in your code, and look for defining each component through the item
If CC50_centricoate= 1 Then Parameter("CC50 centricoate FP foundation:1", "foundation")=1 End If If Powder_feeder_Left=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder L:1", "Powder_feeder_Left", 0, 1) Parameter("CC50 powder feeder L:1", "Powder_feeder_Left") = 1 ul End If If Powder_feeder_Left=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder L:1", "Powder_feeder_Left", 0, 1) Parameter("CC50 powder feeder L:1", "Powder_feeder_Left") = 0 ul End If If Powder_feeder_Left_Fantom=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom", 0, 1) Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom") = 1 ul End If If Powder_feeder_Left_Fantom=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom", 0, 1) Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom") = 0 ul End If If Powder_feeder_Right=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder R:1", "Powder_feeder_Right", 0, 1) Parameter("CC50 powder feeder R:1", "Powder_feeder_Right") = 1 ul End If If Powder_feeder_Right=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder R:1", "Powder_feeder_Right", 0, 1) Parameter("CC50 powder feeder R:1", "Powder_feeder_Right") =0 ul End If If Powder_feeder_Right_Fantom=1 ul Then MultiValue.SetListInComponent("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom", 0, 1) Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom") = 1 ul End If If Powder_feeder_Right_Fantom=0 ul Then MultiValue.SetListInComponent("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom", 0, 1) Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom") = 0 ul End If If Door_Fantom=1 ul Then MultiValue.SetListInComponent("CC50 Door:1", "Door_Fantom", 0, 1) Parameter("CC50 Door:1", "Door_Fantom") = 1 ul End If If Door_Fantom=0 ul Then MultiValue.SetListInComponent("CC50 Door:1", "Door_Fantom", 0, 1) Parameter("CC50 Door:1", "Door_Fantom") = 0 ul End If If Powder_feeder_Left=0 ul Then Powder_feeder_Left_Fantom = 0 ul Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom")= 0 ul ElseIf Powder_feeder_Left_Fantom = 1 ul Then Parameter("CC50 powder feeder L fantom:1", "Powder_feeder_Left_Fantom")= 1 ul End If If Powder_feeder_Right=0 ul Then Powder_feeder_Right_Fantom = 0 ul Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom")= 0 ul ElseIf Powder_feeder_Right_Fantom = 1 ul Then Parameter("CC50 powder feeder R fantom:1", "Powder_feeder_Right_fantom")= 1 ul End If
It's hard work, but it ensures there will be no problems later. Maybe there are other methods this has worked for me pretty well. regards
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I understend your point, but I don´t understend how and where to make this changes…:(
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can you attach your file here?
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
not that one, but I create a new one...similar.
and Thank again for the help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is an example. (You attach only the assembly file, its components are missing, so I do not know the parameters of each part)
There is an assembly parameter, when "feeder_L =" ON "" will change the parameter "d0" of the "Cub" part to the value 1.2.
when "feeder_L =" OFF "" the parameter "d0" of the "feeder_L" part is changed to the value 5.
Note how the entry of the part name has been modified, so when you change the name of the file you will not have problems.
Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oDef As AssemblyComponentDefinition oDef = oDoc.ComponentDefinition Dim oCub As ComponentOccurrence = oDef.Occurrences.Item(1) Dim oFeederL As ComponentOccurrence = oDef.Occurrences.Item(2) Dim oFeederR As ComponentOccurrence = oDef.Occurrences.Item(3) MessageBox.Show(oCub.Name) MessageBox.Show(oFeederL.Name) MessageBox.Show(oFeederR.Name) If feeder_L = "ON" Then Parameter(oCub.Name, "d0") = 1.2 End If If feeder_L = "OFF" Then Parameter(oFeederL.Name, "d0") = 5 End If
Please accept as solution and give likes if applicable.
I am attaching my Upwork profile for specific queries.
Sergio Daniel Suarez
Mechanical Designer
| Upwork Profile | LinkedIn
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
hmmm....
I tried but some things are still not working. If you still have the patience can you show me again...?
I attach 3 files here
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
