×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

CASE statements of IF / THEN within CATIA parameters?

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

RE: CASE statements of IF / THEN within CATIA parameters?

I think you will need to use a Reaction in a Knowlege Rule (KWA functionality).

RE: CASE statements of IF / THEN within CATIA parameters?

If you do not have KWA Functionality you can use the "FOG"
Law it should work for what you want.

RE: CASE statements of IF / THEN within CATIA parameters?

(OP)
I tried using FOG but cannot quite get it to work.  It seems (thru the help files) that you have to define parameters inside the FOG law function but I'm not sure how to relate these to actual parameters or sketch dimensions in the part?  I kept getting an error whenever I tried to link to another parameter inside the dialogue box.  

Can someone offer more help?  

--Jay

RE: CASE statements of IF / THEN within CATIA parameters?

Albigger:

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?

(OP)
Kapmc -

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?

Albigger :

Anytime

RE: CASE statements of IF / THEN within CATIA parameters?

(OP)
Is there anyway to activate/deactive a component as a result of a parameter value?  

--Jay

RE: CASE statements of IF / THEN within CATIA parameters?

The fog laws will only work for lengths and angles, boolean operations would require KWA.  With KWA you could put multiple results together
If a==b
{
rad=.125in
height=3in
}

Regards,
Derek

RE: CASE statements of IF / THEN within CATIA parameters?

Jay,

I think you need KWA for this... and set a rule.

Eric N.
indocti discant et ament meminisse periti

RE: CASE statements of IF / THEN within CATIA parameters?

(OP)
Ok, how about with strings.  


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?

You just can't using strings with the laws. Define your configurations as 0, 1, 2 and then evaluate these values with the law.

-Hora

RE: CASE statements of IF / THEN within CATIA parameters?

(OP)
Well, that's really not what I wanted, with many configurations I wanted to have descriptive names.  

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?

Albigger:

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?

Albigger -

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?

(OP)
Actually, I had setup a design table originally (not sure if that's what you mean, or if there's another way to tie in a spreadsheet) and it seemed a little cumbersome.  Plus, if I copied/pasted the part body (with the design table) into another part and wanted multiple copies, sometimes CATIA wouldn't let me have different configurations of that part body in the same CATPart.  Of course I kind of self-taught myself the design table approach, so maybe I did not set it up correctly.  


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?

Sometimes, you can skip the formulas in Catia altogether, and handle it in your design table.  Use simple numbers in your parameter relations, and do all the math in the spreadsheet.  It's a pretty good solution in many cases.

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?

Albigger -  you should look into powercopies, yet another powerful tool.  This should help out with multiple configurations in the same CATPart

Regards,
Derek

RE: CASE statements of IF / THEN within CATIA parameters?

Albigger:

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?

The fog laws I would be refering to would be to control the configuration rows within the design table.

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?

I must clarify first, I did not mean to actualy insert a fog law within the design table but to only help control the design table within a part.

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?

Solid7 I run HD2 license and I can write this rule.

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?

(OP)
I believe that is what we have (HD2) and I can write the simple FoG law as Kapmc stated above, though I still haven't gotten quite to where I want to be (but I think I understand more thanks to all the input).  

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?

(OP)
Yeah I couldn't find it either for a while, but its underneath the design table icon (in a sub-menu).

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?

Mine is located under the Design table icon.

RE: CASE statements of IF / THEN within CATIA parameters?

Albigger:

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?

(OP)
Right now just curious about catalogs in general.  I haven't used them or even seen them used, so I'll try to work my way thru the documentation (when I get some time) but I'm sure I'll be back if I have specific questions.  

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources