iLogic rule to select and update beam size

iLogic rule to select and update beam size

aprajapati3C
Advocate Advocate
1,139 Views
6 Replies
Message 1 of 7

iLogic rule to select and update beam size

aprajapati3C
Advocate
Advocate

I am new to ilogic and search on google whenever i need help but i am stuck on this.

 

We need to create gusset / bracket for structural beams on daily basis. And everytime we need to measure in the model to define the size of the gusset.

 

I want to create a template where i have a dropdown list of all the beams and an rule that will update the sizes accordingly. And i am not sure how to create a rule for that. See attached file. For some reason text parameter in recognized in "Case rule".

 

0 Likes
Accepted solutions (1)
1,140 Views
6 Replies
Replies (6)
Message 2 of 7

blandb
Mentor
Mentor
Accepted solution

Look at the parameter options again, vs what you have in the case statement. Also, make sure the case you are looking for from the dropdown of UB is in "" such as:

 

case "203x133x30"

Autodesk Certified Professional
Message 3 of 7

aprajapati3C
Advocate
Advocate

Thanks for the help @blandb .

That worked perfectly. Now i stumbled upon another issue. i want to create different rules for different types of beams and want a rule that can suppress other rules when one is active. For eg. i want have separate rule for UB, UC, HE, JIS etc beams. And in ilogic form when i select one beam it should suppress all other rules. But i didnt find any code to suppress a rule. Even a code to suppress a parameter would work for me (i think).

0 Likes
Message 4 of 7

dutt.thakar
Collaborator
Collaborator

@aprajapati3C 

I am not having Inventor 2021, so I can not open your file, for your info, you can not suppress a parameter in Inventor so if you are thinking to suppress a parameter, that will not work, instead, you can suppress other iLogic rules using iLogic. Try below sample, which suppresses "Rule1" from "Rule2", make sure you need to edit this as per your requirement, you can also name your rules in such a way that, if you want to suppress bunch of rules from one rule you can use For loop and iterate through the rules with that contains specific letters and suppress them.

 

The below code is a sample on how to suppress a rule using iLogic.

 

Dim iLogicAuto = iLogicVb.Automation

Dim oRule = iLogicAuto.GetRule(ThisDoc.Document, "Rule1") ' the bold letter here is a rule name that you want to suppress, you can change it as per requirement

oRule.IsActive = False

Hope this will be helpful.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
Message 5 of 7

aprajapati3C
Advocate
Advocate

Thanks @dutt.thakar. That did not help me a lot but it gave a lead to find an alternative. I am happy with what i have now. see attached. its working exactly as i wanted it to be. There is only one thing that is annoying.  In the form when i change the beam (eg. from "UB" to "HE") the "HE" drop down list gets activated as expected but the model does not update with dimension of default "HE" beam i.e. "HEB 100".  This is not a problem because when i select next member of the HE beam the model gets updated with the correct size.

 

As i said its not a big deal but if i can solve this it will be a perfect template for me.e

0 Likes
Message 6 of 7

A.Acheson
Mentor
Mentor

Due to not having 2021 I am unable to see the rules and parameters etc. But judging from the description of the issue the default value of category HE (HEB 100) has not been set when in the UB  category or HC.  I could be wrong however. Attached is a sample with one category and size.

If this solved a problem, please click (accept) as solution.‌‌‌‌
Or if this helped you, please, click (like)‌‌
Regards
Alan
0 Likes
Message 7 of 7

dutt.thakar
Collaborator
Collaborator

@aprajapati3C 

 

When setting a multivalue list, please try using this. You can find this snippet in the parameter section inside snippets.

If you always want to show the first value after changing your list, please note that it starts from 0 as a default index.

 

MultiValue.SetValueOptions(True, DefaultIndex := 0)' try using this line before every multivalue setlist line in your code
MultiiValue.SetList("HE","HEB 100","HEB 120")

 

Hope this will work.

If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!


Regards,
Dutt Thakar
LinkedIn
0 Likes