Inventor Engineer-To-Order (Read-Only)
Welcome to Autodesk’s Inventor ETO Forums. Share your knowledge, ask questions, and explore popular Inventor ETO topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Drive default Value of a parameter

12 REPLIES 12
SOLVED
Reply
Message 1 of 13
TIMOHART
897 Views, 12 Replies

Drive default Value of a parameter

How can I do a sort of an errror handling by setting a parameter back to its default in case of a certain event ?

Thank you / Regards

Timo

ETO 2014 R2
HP Z420 / Win7 X64
16GB RAM
Nvidia Quadro K4000

12 REPLIES 12
Message 2 of 13
JackGregory
in reply to: TIMOHART

Well, it is unclear to me precisely what you want, but your wording implies something that I need to mention: If you supply something as a parameter to a child, then that is what was supplied, and nothing can "go back" and make that not the case.  You can certainly choose to ignore the parameter, but your notion of procedural backing up here is definitely the wrong way to think about Intent.

 

So you probably need another level to handle bad parameters, or some kind of validation.  If you have a case, then we could look at approaches.

 

Message 3 of 13
TIMOHART
in reply to: JackGregory

Thank you Jack ,

 

I admit we do not want to go procedural . But I was thinking that I can reset a parameter on based of an event somehow .

The listing shows case2 where the error message is put . This event should somehow reset one particular parameter which was

leading to this Error . With unbind ,delete dynamic parameter and evaluate this is possible using C# and an Interface . But somehow

this effords are to costly and time consuming. Therefore we like to do such thing within ETO only.

 

LogicBearing.JPG

 

Regards

Timo

ETO 2014 R2
HP Z420 / Win7 X64
16GB RAM
Nvidia Quadro K4000

Message 4 of 13
JackGregory
in reply to: TIMOHART

You need the separate the concepts of "supplied and might be wrong" from "this is what I am going to use".  That is the point I am trying to make.  Your example doesn't make sense to me.  If it is not permitted to have that combination, but you don't want to halt, then skip the error and proceed.  It is very common to have supplied parameters coming from "outside" your rules to not make sense or be consistent.  That is something your first layer of rules needs to handle, just like any user inputs.

 

Maybe you have parameters named <something>_supplied, and then you make sure that <something> is valid.  Then all of the rules  that are based on it just evaluated <something>, so they always get something that has been validated.

 

Message 5 of 13
TIMOHART
in reply to: JackGregory

Hello Jack ,

 

Thank you for your patience. I might have written the wrong words and we are getting towards a communication issue here as my english is not as good. Sorry - I will try to explain the issue again on basis of the picture above.  We are talking about the Rule logicBearing which defines 8 cases of combination of 3 parameters.  All the 3 Parameters are valid user input parameters . However the combination of the 3 need to follow our product rules as a "Lube Oil pump" without "Forced Feed" is not a allowed combination.  In this case ETO does not produce an Error this is the wrong wording I used.  I Just need to tell the User that this combination is not allowed. Therefore I put the com_msg. 

 

As the user now already pressed APPLY or OK and also pressed OK on the com_msgbox the parameter combination is still wrong as the "LubeOilPump" has the value 1 . This dynamic value I want to delete and reset within ETO. In C# I could have used m_thePart.GetDynamicRules()[rulename].Delete();

So the only thing I ask is if there is a equal functionality within ETO I can use to do such things. Same would be

m_thePart.Unbind(rule1);

m_thePart.EvaluateExpression(new AI.Source(rule1))

 

Rulename and Rule1 are Rulenames in ETO

m_thePart is the Object --> Autodesk Intent Part

AI stands for Autodesk Intent Lybrary (API)

 

I am not experienced using the API within ETO so this I guess this is my issue and overall its the question how I apply such a function or method within my case.

 

Thank you / Regards

Timo

ETO 2014 R2
HP Z420 / Win7 X64
16GB RAM
Nvidia Quadro K4000

Message 6 of 13
JackGregory
in reply to: TIMOHART

Well, the bottom line is you cannot change rules while running rules.  The reactor stuff appears to do this, but it is very carefully written to actually not do it.  There are two solutions, built-in, that I know of:

1. Validator rules.  These rules perform validation.  It allows you to "correct" inputs that are not valid to those that are.  This seems close to your situation.

2. Group rules.  These are rules that actually allow UI's to "turn off" incompatible inputs.  These are used in the Arc designs, where you can't provide both Radius AND Diameter, but either one is fine.  It is designed for the classic case of when there are several different ways to specify something, but these different ways are partially incompatible.  This is obviously used when you have control over the UI, because you need to keep asking the API whether certain parameters are still "open" given a set of ones already given.  This is a complex topic that I can't really tackle here.

 

I suspect even the Validator rules will be complicated for you, because of the need to handle combinations.  YOu can throw an error from them as a trivial case.  But whatever is handling the input needs to handle that.

Message 7 of 13
ebachrach
in reply to: JackGregory

i am not sure if reactors can't help here. They are limited in that they cannot change themselves, but they can be used to change others.

So if in supplying parameter1, parameter2's modified value must be removed, you can do that with reactors. 

 

 

 

Note that the ETO UITools, which put a child object in front of each parameter, have these behvaior built in with some simplifications.

 

Elly


--
Autodesk
Elly Bachrach
ETO/CTO Solutions Designer
Intelligent Configuration Solutions
Mobile +1 (773) 401-6980
elly.bachrach@gmail.com

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 8 of 13
TIMOHART
in reply to: ebachrach

Thank you Elly for this hint ,  I 've tried to figure out how to use those reactors but unfortunatly I can't .

Here is my coding . 

 

First part simply defines the default value during startup and while choosing a pump model and size. So this is that the SQL database will find at least one entry and not running in EOF.

 

Second I try to acoid that in case of the if clause is true Client will choose sleeve. Therefore I did the delete and create dynammic rule . But the actions are not taking place.

 

reactors.JPG

Would be great to know if I am on the right way ?

 

 

Thank you / Regards

Timo

ETO 2014 R2
HP Z420 / Win7 X64
16GB RAM
Nvidia Quadro K4000

Message 9 of 13
JackGregory
in reply to: TIMOHART

As Elly said, you can't change a rule with a reactor on itself.  This appears to be what you are attempting.

Message 10 of 13
ebachrach
in reply to: TIMOHART

i did some testing, and actually you should be able to override a dyanmic change to a rule from its own reactor, using Postmodify ()

In your sample code, I believe the reason it fails might be that you are referencing the wrong part.  the part in which the rule is being written is Me (or Self), not Parent.

 

Warning - as far as i know it is your responsiblity to make sure you don't enter a recursive event state, in which you keep changing the value.  Your user changed triggered the event once, your createdynamicrule will trigger it a second time.  Your test is very simple and on the second time through no further change is made.  But as you explore interdependent changes where changing rule1 is supposed to reset rule 2, you could encounter this more easily.  You will know you have encountered this when Inventor stops working 🙂

 

You can work around that too with your own "inevent" checker rule that you set from within the event.

 

Elly


--
Autodesk
Elly Bachrach
ETO/CTO Solutions Designer
Intelligent Configuration Solutions
Mobile +1 (773) 401-6980
elly.bachrach@gmail.com

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************
Message 11 of 13
TIMOHART
in reply to: ebachrach

Thank you Elly for this information .   I did some modification and will now change the Psize Parameter as an event to put Lager to default .

Unfortunatly the string formular gets not read as a string and therefore I get an error. NO SUCH RULE antifriction now . Do you have an idea ?

 

Thank you / Regards

Timo

 

reactors#2.JPG

ETO 2014 R2
HP Z420 / Win7 X64
16GB RAM
Nvidia Quadro K4000

Message 12 of 13
TIMOHART
in reply to: TIMOHART

Here you see the dynamic rule generated and the one how it SHOULD look like.

Generated:

reactors#3.JPG

 

How I need it to appear:

reactors#4.JPG

 

I hope we find a solution .

T´hank you / Regards

Timo

ETO 2014 R2
HP Z420 / Win7 X64
16GB RAM
Nvidia Quadro K4000

Message 13 of 13
ebachrach
in reply to: TIMOHART

What you are missing is turning your value into a formula. 

Use the RuleString() Function to do this.

In your case it will wrap your string in the extra quotes, so that when the dynamic rule is created, "sleeve" is understood to be a string, not sleeve.

 

Elly


--
Autodesk
Elly Bachrach
ETO/CTO Solutions Designer
Intelligent Configuration Solutions
Mobile +1 (773) 401-6980
elly.bachrach@gmail.com

************************************************************************************
If this post helps, please click the "thumbs up" to give kudos
If this post answers your question, please click "Accept as Solution"
************************************************************************************

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report