×
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

Controlling Decimal Places Of A Parameter Value Through A Formula

Controlling Decimal Places Of A Parameter Value Through A Formula

Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
Using Catia V5R19, Service Pack 8, Build Number 19;

Is it possible to control the decimal places of a value parameter by means of a formula?

Any response will be greatly appreciated!

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

Perhaps.

Tools - Options - General - Parameters and Measures - Units
this will show on a global scale for all parameters.

You can also use the round math function.  see attached.
I made 4 parameters
length.1 - input
length.2 - result
round_num (integer)for the number of decimal places to round to
Unit (string) multi pull down for in or mm  (inch or milli)

Regards,
Derek
 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
Derek, I'm getting an error when placing the units. Can you cut & paste a picture of the Formula Editor popup menu to illustrate how to actually piece together the formula?

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

in the formula editor it would look like

if you want to forget Unit as a variable string and round_num as a variable integer

below is units inch and 2 decimal places
round(Length.1,"in",2)


round(Length.1,Unit,round_num)

what is important is the variable types.

Length.1 is a length
Length.2 is a Length
Unit is a type string
round_num is type integer

what error are you receiving?

 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
The error that I'm getting is,

Syntax Error line 1 :
Parameter Radius.1 cannot be used in this context.
Do you want to go back to the editor (otherwise the relation will be broken and deactivated)

I want to associate a driving dimension in the sketch environment with a formula by;
• right-clicking the dimension
• Scrolling down to xxx.x object
• Clicking on "Edit formula"

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

Radius.1 in the Constraint definition box can not be set to Dimension -- Diameter and have a formula attached to it.  Set it to Radius and you can simply apply a /2 at the end of your formula.


Retarded I know, but older versions of Catia this was a Radius only and would cause severe problems with peoples scripts and code if they toggled it in a major revision change.


Regards,
Derek
 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
I tried it with a length dimension and it gave me the same error.

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
What I am trying to achieve is the following;
•Control the decimal precision of a driving dimension in the part environment
•Dimension that driving dimension in a drawing maintaining the decimal precision from the part environment, over writing the global decimal precision.

I have been able to achieve this by locking the parameters, but the drawback is that you have to unlock the parameters if you want to edit the sketch and/or feature dimension.

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

I am scared to ask why you would like to do this but Why?

 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
Derek don't be scared, it's actually a good question.

Answer:
When I detail features (i.e. Detailing a counterbore from its top view) using the "Attribute Link" inside a Text editor box, the decimal precision is displayed with respect to what the global settings are at that moment. At first it's OK, but if you change the global decimal precision setting and update the drawing, those linked values get updated to the new decimal precision setting. I want to eliminate this from happening. So I figured if I can force the sketched/part feature dimension in the desired decimal precision it will never change regardless of what the global setting precision is.

RE: Controlling Decimal Places Of A Parameter Value Through A Formula


I see, interesting way of locking the dimension.

 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
The reason being is if I have several different sizes of counterbores, I don't want to create a section view for everyone because the drawing can become very messy. Might you have a different approach?

RE: Controlling Decimal Places Of A Parameter Value Through A Formula



A couple of things to think about.

1)
Tools - Options - Mechanical Design - Draft - Administration

Prevent update of standard
Prevent switch of standard

2)
Select the dimension in drafting - edit properties
Graphics tab - Turn off pickable.
This will make it impossible to select the dimension on the screen
To set it back you will have to search and select - all dimensions and set them all back to pickable.

3)
Just a time saver but do you use Generate Dimensions?  Works great if your models are have constraints and history.


Regards,
Derek

 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
1. What I'm trying to accomplish isn't a standard because it's not always the case. In the future I might need feature dimensions with higher or lower precision.
2. I have turned off "pickable" and it does not prevent the values from changing because they are dependent on the global settings in "Parameters and Measure"/ "Units".
3. No, I've never used "Generate Dimensions" always the standard dimensions toolbar.

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
I've tried both options, "Round (Real): Real " & "Round (Real, String, Integer): Real" and I can't make the "inch" units work. Can anyone type out exactly how the formula should be in either case to make the units convert? Thanks!

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

round(12.4555in,"in",2)

 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
Derek thanks a lot, it works now. Unfortunately, it doesn't give me what I was hoping for. The "round" function actually rounds the value of the sketch to the desired decimal place of the actual part and not the dimension value in the drawing. The dimension is still controlled by the global setting.

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

Yes but you can select the dimension value and set the decimal place.  This should not be adjusted unless the operator specifically changes it.
 

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
Not when you use "attribute link".

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

(OP)
I'm having problems with the round function.

Can someone please?
1. Create a "Pad"
2. Create a counter bore using the "Hole" function
3. High-light the counter bore diameter, "right-click" the dimension and click "Edit Formula..."
4. Click "Math" under "Dictionary"
5. Click "round (Real): Real" function under "Members of math"
6. Try rounding the counter bore dimension value to 2 decimal places in "inch" units

I can't figure out number 6, can anyone help?

Any response will be greatly appreciated!

RE: Controlling Decimal Places Of A Parameter Value Through A Formula

Torsional,
    You can not round the input value of counter bore and place the output back as the input.  This causes a logical loop.  You would need to create a parameter for counter bore size and if you are going to that extent you might as well round the number yourself.
 

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