new to iLogic-help. Features turning off unexpedadly

new to iLogic-help. Features turning off unexpedadly

Anonymous
Not applicable
896 Views
8 Replies
Message 1 of 9

new to iLogic-help. Features turning off unexpedadly

Anonymous
Not applicable

Hi, 

 

First time here looking for answers. New to iLogic and my company is having me automate out product system. That's the short and skinny.

 

Here's the fuzz.

 

A model has several different configurations based on selectable 'standard options' by the customer.

I have built a model to update size, holes, shaft lengths, diameters, thicknesses, and other features like flats, forks, and cross holes...etc.

All of them work great independently w/o issue. 

I created Rules to turn these features on/off depending on what 'standard option' is selected.

Now, a couple of the rules perform a similar task of turning on/off some features that are present across several 'standard options'. This is where the trouble is.

If all the rules are turned on then the rules that turn on/off the same feature or have the same 'standard option' fail to properly turn on/off.

What is happening is that the feature that is to turn on/off initially performs the correct function then undoes that same function. 

So when more than one rule is active at the same time(any rule that shares a feature that needed to go on/off) the lot of them fail to work properly. 

 

I have created two rules. One with all the code for all configurations and 'standard options', and then created a rule for each 'standard option' so that I can find where the problem is... can't find the problem.

 

Specifically the, CAD_SHAFT_FLAT is being turned off or just not responding when everything is unsuppressed.

 

*important* either have the Rule Gearhead Options On and have everything else underneath it suppressed or do the opposite. All the NA, KS1,KS2, etc is is an expansion of the Gearhead Option rule. 

 

I have attached the file, long code, and a few snips for clarification.

 

I am desperate... so I would be immensely grateful for any help that leads to the solution to my issue.

 

Thank you all in advanced.

Josh B.

 

 

0 Likes
897 Views
8 Replies
Replies (8)
Message 2 of 9

bhavik4244
Collaborator
Collaborator

@Anonymous 

 

First thing, it seems to be having a problem with executing the rules in the proper sequence. In order to achieve that we have the option to choose in the rule that does not run automatically (here below snap for that). 

 

bhavik4244_0-1609482172045.png

 

2nd thing, in the rule "CAD_GH_SHAFT_FLAT", the parameter " CAD_GH_SHAFT_FLAT " was deleted and the feature name had a spelling mistake that's why it wasn't making any sense. I corrected it as per my understanding please double chek it. I have attached the part as well.

 

I have added the "Update" rule and form to update it after selecting the parameters. Update it from Form only.

 

P.S.: I haven't checked the model thoroughly with all configurations, but from here you may overcome the issues you're facing with running unwanted rules.

 

 

If it solves your issue then please accept it as a solution.

Cheers,

Bhavik Suthar

LinkedIn 

 


Bhavik Suthar
0 Likes
Message 3 of 9

Anonymous
Not applicable

 

Thanks for taking the time to look into my issue. I am running Inventor 2017 So I am unable to open the file you've provided. 

 

I have read your notes and are attempting to replicate your corrections from your findings. If at all possible I would appreciate a file that will work for my 2017 version 🙂 

 

Thanks for the help so far!

Best,

Josh B.

0 Likes
Message 4 of 9

bhavik4244
Collaborator
Collaborator

@Anonymous 

 

Unfortunately😔 I don't have Inventor 2017 it's upgraded to 2019 else I will do it for you. However, you may follow the steps I had mentioned earlier. Feel free to post me if you stuck somewhere.


Bhavik Suthar
0 Likes
Message 5 of 9

Anonymous
Not applicable

Also, I am not sure that we want to uncheck run rule automatically? We are using a 3rd party configiration software that keys off of the "Gearhead options" rule. it sees which KS-number is being called for and then the magic happens.

 

If the rule does not run automatically then the model will not update properly when the customer selects a particular gearhead option during the configuration process.

 

I was able to open the file after all on my personal machine. And tested the update. When switching the "KS#" no model updates occur.

 

I need to maintain the function that if the "KS#" is changed the model updates.

 

Could you also tell me where you fixed the spelling error for CAD_GH_SHAFT_FLAT?

 

Best,

Josh B.

0 Likes
Message 6 of 9

Anonymous
Not applicable

I managed to find and use a 2020 inventor so Testing now

0 Likes
Message 7 of 9

Anonymous
Not applicable

Okay, So taking your tweaks and going with them I can now turn on/off the shaft flat... good. 

Is there a string that will *stop* running a rule, even if it is in the middle of running it, once a parameter has been set or changes have been made?

For instance. Lets say the "Gearhead_Options" rule runs and my option is NA. NA is the first code chunk... or executable model change in that rult. Lets say that it changes the shaft and adds the flat like it is suppose to. And if you look you can see that it does add the flat, then you clock the mesage box closed and it goes away. Lets say that you can *STOP* running the rule after it makes the changes... then it would stay correct and not override itself by continuing to finish running the rule... you see what I am getting at?

 

What is that string command that lets me do this?

 

Thanks! With you helping me, I have hope this can be solved!

Josh B.

0 Likes
Message 8 of 9

J-Camper
Advisor
Advisor

@Anonymous,

 

I have a few notes that I think would help you.  I have attached a part [2020 Inventor], with these suggestions implemented. 

 

First, you mentioned wanting to "stop" running after finding the correct option.  You need to integrate all your separate If statements into 1, multi-level Statement.  Level 1 is the state of "CAD_GH_DIA", then for each state of "CAD_GH_DIA" you are checking the state of "GEARHEAD_options" as Level 2.  I moved all of your "Else" statements in your separate If statements to the beginning of the rule to "Set Default states". The rule now looks like this:

 

 

'Set Default states
Feature.IsActive("CAD_GH_SHAFT_FLAT") = False
Feature.IsActive("CAD_GH_SHAFT_FLAT_DBL") = False
Feature.IsActive("KEYWAY_22GPT") = False
'Feature.IsActive("CAD_GH_SHAFT_FLAT") = False 'repeated
'Feature.IsActive("CAD_GH_SHAFT_FLAT") = False 'repeated
Feature.IsActive("CAD_GH_CROSSHOLE") = False
'Feature.IsActive("CAD_GH_SHAFT_FLAT") = False 'repeated
Feature.IsActive("22GPT_FRONT_AXIAL_THREADED_HOLE") = False
Feature.IsActive("CAD_GH_SHAFT_FORK") = False

'Start looking for options
If CAD_GH_DIA = 22 'Filter level 1: Is CAD_GH_DIA = 22?
	If GEARHEAD_Options = "NA" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 16.3 
		Feature.IsActive("CAD_GH_SHAFT_FLAT") = True
		CAD_GH_SHAFT_FLAT_LGTH = 10
		d172 = 5.4
		MessageBox.Show ("ln39 GH 16.3mm long shaft & flat 10mm lgth NA")
	Else If GEARHEAD_Options = "KS1" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 16.3
		MessageBox.Show ("ln3 GH short round 16.3mm lgth KS1")
	Else If GEARHEAD_Options = "KS2" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 27
		MessageBox.Show ("ln9 GH long round shaft 27mm lght KS2")
	Else If GEARHEAD_Options = "KS3" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 21
		Feature.IsActive("CAD_GH_SHAFT_FLAT_DBL") = True 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_FLAT_DBL_LGTH = 12
		d173 = 5.0
		MessageBox.Show ("ln18 GH double long flat 12mm lgth on 21mm lght shaft KS3")
	Else If GEARHEAD_Options = "KS4" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 21
		Feature.IsActive("KEYWAY_22GPT") = True
		MessageBox.Show ("ln28 GH long shaft & keyway lgth on 21mm lght shaft KS4")
	Else If GEARHEAD_Options = "KS5" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 21
		Feature.IsActive("CAD_GH_SHAFT_FLAT") = True
		CAD_GH_SHAFT_FLAT_LGTH = 12
		d172 = 5.4
		MessageBox.Show ("ln39 GH 21mm long shaft & flat 12mm lgth KS5")
	Else If GEARHEAD_Options = "KS6" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 21
		Feature.IsActive("CAD_GH_SHAFT_FLAT") = True
		CAD_GH_SHAFT_FLAT_LGTH = 12
		d172 = 5.4
		Feature.IsActive("CAD_GH_CROSSHOLE") = True
		d202 = 6
		'd175 = 2
		'MessageBox.Show ("ln53 GH 21mm long shaft & 2mm cross hole KS5")
	Else If GEARHEAD_Options = "KS7" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 16.3
		Feature.IsActive("CAD_GH_SHAFT_FLAT") = True
		CAD_GH_SHAFT_FLAT_LGTH = 10
		d172 = 5.4
		Feature.IsActive("22GPT_FRONT_AXIAL_THREADED_HOLE") = True
		d178 = 2.5
		d183 = 5
		MessageBox.Show ("ln68 GH 21mm long shaft & 10mm flat & 2mm cross hole KS7")
	Else If GEARHEAD_Options = "KS8" Then 'Filter level 2: What is the state of GEARHEAD_Options?
		CAD_GH_SHAFT_LGTH = 16.3
		Feature.IsActive("CAD_GH_SHAFT_FORK") = True
		d178 = 2.5
		d183 = 5
		MessageBox.Show("ln81 GH short round 16.3mm lgth & shaft fork KS8")
	End If 'Filter level 2: End
Else 'Filter level 1: CAD_GH_DIA <> 22
	MessageBox.Show("Parameter CAD_GH_DIA does not equal 22", "Else Level 1")
End If 'Filter level 1: End
'Update once @ the end
iLogicVb.UpdateWhenDone = True

 

 

 

I did a similar modification to Rule: "CAD_GH_DIA_SHAFT_PILOT_PRESSRING_DIA_LGTH_THREADED_HOLES"  which I will not post unless you can't open the file, for post length.

 

I noticed an error when changing "CAD_GH_DIA" from a larger diameter to a smaller diameter [ changing parameter outside of the Form], due to hole features not affecting the reduced diameter solid.  I thought setting the "Update" rule to the Event Trigger for "Any Model Change" would stop that from happening.  Unfortunately, I had to set it to trigger at "Any Parameter Change", which is not recommended for rules with user interaction, like message boxes, because any parameter change activates those messageboxes.  If the message boxes, that say what option was selected, were not going to appear after testing is complete, it might be a viable option.  Without any event trigger [and not using the form to change paramter values], as long as the error is accepted, the feature suppression gets updated by running "Update".

 

Let me know if you have any other questions or if you need the other rules I updated posted here.  I did not look at any other the suppressed rules.

0 Likes
Message 9 of 9

Anonymous
Not applicable

Firstly, you have my highest praise for getting the KS#'s to work.

I mean this: Thank You.

 

The message boxes are only going to be active through the testing phase of this. It was so I would "step" through the activation of the different settings turning on/off. They will not be active in final form.

 

Regarding the error of going from a Larger GH Dia to a smaller one, it is not acting this way on the original file. Also, it seems to be having trouble on my machine with the updated code. Not a problem, as I believe I can follow your lead and correct this on my end. I DO think that because the GEARHEAD_OPTIONS code is NOT YET fully completed (need to add the same blocks of code to represent the KS#'s for the 32mm and 42mm Dia versions) that we are having some issues. 

 

I will complete the 'Rule' in GEARHEAD_OPTIONS and get back to you.

 

Much appreciated,

Josh B.

 

0 Likes