CASE statements of IF / THEN within CATIA parameters?
CASE statements of IF / THEN within CATIA parameters?
(OP)
Hello
I am trying to build a part with multiple configurations. This part will for example, have a size parameter. The user can change this parameter (from a list of available drop-downs).
I then want other dimensions to update according to this parameter, but not a formula. Is there a way to do that?
I know, for instance, I can put something like =parameter*2 but instead I want a series of IF statements, and results.
As a separate question, the driving parameter is a drop-down of length values. Do I have to have the values displayed, or can I name them like "config A" "config B" etc...?
Thanks.
--Jay
I am trying to build a part with multiple configurations. This part will for example, have a size parameter. The user can change this parameter (from a list of available drop-downs).
I then want other dimensions to update according to this parameter, but not a formula. Is there a way to do that?
I know, for instance, I can put something like =parameter*2 but instead I want a series of IF statements, and results.
As a separate question, the driving parameter is a drop-down of length values. Do I have to have the values displayed, or can I name them like "config A" "config B" etc...?
Thanks.
--Jay





RE: CASE statements of IF / THEN within CATIA parameters?
RE: CASE statements of IF / THEN within CATIA parameters?
Law it should work for what you want.
RE: CASE statements of IF / THEN within CATIA parameters?
Can someone offer more help?
--Jay
RE: CASE statements of IF / THEN within CATIA parameters?
Here is an example:
In the fog law editor type this statement.
If FormalLength.1== 3.0mm
{FormalLength.2 = 1.0 mm}
Exit the editor
Create two lenght parameters.
One parameter with 3.0mm as a value(lenght-1)
When you create the second lenght parameter(lenght-2) go to add formula,DC on the fog law you just created,then select law(under dictionary)DC the statement under members of law(Evaluate(real):real),Then Click on the first paramter(lenght-1) you created.
When you hit ok in the formula editor an update message will appear hit yes.
That is it.
Remeber fog laws are really limited.For every valu you have in you drop down box you will need to add another
statement in you fog law.
For example:
If FormalLength.1== 3.0mm
{FormalLength.2 = 1.0 mm}
If FormalLength.1== 4.0mm
{FormalLength.2 = 2.0 mm}
and so on.
Hope this helps.
RE: CASE statements of IF / THEN within CATIA parameters?
THANK YOU so much!
This helps me tremendously. Obviously the code will not be as succinct as some other languages, but this will let me do what I want (I think, for now).
I still have to play with it some, but at least this is a working example to go from.
Thanks again for being so helpful.
--Jay
RE: CASE statements of IF / THEN within CATIA parameters?
Anytime
RE: CASE statements of IF / THEN within CATIA parameters?
--Jay
RE: CASE statements of IF / THEN within CATIA parameters?
If a==b
{
rad=.125in
height=3in
}
Regards,
Derek
RE: CASE statements of IF / THEN within CATIA parameters?
I think you need KWA for this... and set a rule.
indocti discant et ament meminisse periti
RE: CASE statements of IF / THEN within CATIA parameters?
I made a law such as:
If FormalString.1=="Config A"
{FormalLength.1=.25in}
If FormalString.1=="Config B"
{FormalLength.1=.5in}
and that seemed OK. I have a string parameter with multiple values (Config A and Config B). Now how do I link a dimension to this law? I tried the way Kapmc stated above, but it won't let me input a string into the law (it wants a real). Anyway to do this?
Thanks guys for all the help.
RE: CASE statements of IF / THEN within CATIA parameters?
-Hora
RE: CASE statements of IF / THEN within CATIA parameters?
But if it can't be done I'll have to work around it I guess...
RE: CASE statements of IF / THEN within CATIA parameters?
Have you tried to tie a spread sheet to your fog law.
This can expand your range on what you are able to do.
RE: CASE statements of IF / THEN within CATIA parameters?
In the big picture - a KWA license (build license for rules and reactions) is not that expensive, if you consider the ROI. Fog laws are not intended for what you are trying to achieve. If you are running a HD2 or MD2 configurations, you have the runtime license for KWA.
Regards,
Derek
RE: CASE statements of IF / THEN within CATIA parameters?
So I thought it might be easier with just a choicebox parameter inside the partbody, but maybe it won't be easier.
We have quite a few standard parts, different configurations, that we like to insert into our models. A good example would be socket head cap screws or hex nuts etc...
Maybe a catalog would be the best way to do this? I know nothing about catalogs though.
RE: CASE statements of IF / THEN within CATIA parameters?
Just be aware - if you want to do spreadsheet math, keep the formulas out of Catia, so as not to cause unsolvable loops. Make it an "all or nothing" approach.
Contact me through my sig links if you don't understand what I mean.
-----------------------------------------------------------
Catia Design|Catia Design News|Catia V5 blog
RE: CASE statements of IF / THEN within CATIA parameters?
Regards,
Derek
RE: CASE statements of IF / THEN within CATIA parameters?
Buy using a spreedsheet it is best to keep most of the formulas within the spreedsheet itself(as solid7 stated)
,but you can still use parameters and fog laws to help control your results.
As far as your standard parts these all should be created in a catalog, you then can resolve your catalog.This will create individual parts that you can bring into your assembly.
If you need help building a catalog, we can help you with that.
RE: CASE statements of IF / THEN within CATIA parameters?
Yes, but if he could write FoG laws, we wouldn't be discussing any of this, because it would mean that he already had the KWA license...
-----------------------------------------------------------
Catia Design|Catia Design News|Catia V5 blog
RE: CASE statements of IF / THEN within CATIA parameters?
I understand that he does not have the KWA license but one should never shy away from trying to find a work-around.
RE: CASE statements of IF / THEN within CATIA parameters?
FoG laws within the design table? Shy away from a workaround?
I was suggesting a workaround by doing all the calculations inside the Excel spreadsheet. I don't understand how one would create the FoG laws without KWA. Please clarify.
-----------------------------------------------------------
Catia Design|Catia Design News|Catia V5 blog
RE: CASE statements of IF / THEN within CATIA parameters?
If you create a fog law like so:
If FormalLenght == 1in
{FormalInterger = 1}
The FormalInteger would refer to a paramter that will control your configuration Row.
I know that Fog Laws are very limited when you are not running KWA, but they can come in handy.
RE: CASE statements of IF / THEN within CATIA parameters?
While it's true one can RUN the FoG laws without KWA, one cannot CREATE those rules without it. That was my point.
-----------------------------------------------------------
Catia Design|Catia Design News|Catia V5 blog
RE: CASE statements of IF / THEN within CATIA parameters?
I did not want to start a heated discussion about this.
I just wanted to give Albigger some insight on some different ways to get to get the result he was asking for.
RE: CASE statements of IF / THEN within CATIA parameters?
Please don't let me stop any discussion.
I think I should look over catalog techniques for now. Is there documentation available for this?
RE: CASE statements of IF / THEN within CATIA parameters?
I have HD2 license, also. Where can you write the FoG rule? I don't have the icon available, although I did on a KWA license...
I also did not want a debate. My point was to try to clarify the FoG issue. I'm open to the possibility that I'm wrong - I'm just trying to figure out what you're saying.
-----------------------------------------------------------
Catia Design|Catia Design News|Catia V5 blog
RE: CASE statements of IF / THEN within CATIA parameters?
RE: CASE statements of IF / THEN within CATIA parameters?
I can only find it through the commands list. Something wrong with my install, I guess...
-----------------------------------------------------------
Catia Design|Catia Design News|Catia V5 blog
RE: CASE statements of IF / THEN within CATIA parameters?
RE: CASE statements of IF / THEN within CATIA parameters?
The help menu is informative in this area. Is their a specfic area that you are curious about, or is it Catalogs in general?
RE: CASE statements of IF / THEN within CATIA parameters?