×
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

Can UG handle variable/automated expressions?
2

Can UG handle variable/automated expressions?

Can UG handle variable/automated expressions?

(OP)
I'm looking for a way of controling an expression IF a certain condidtion is met. If not, then it defaults back to "X" number. So for example:

If P1 is > 0.05mm, then P2=35mm. If P1 is < 0.05mm, then P2=5mm.

Is this possible in NX5? I'm building an assembly that depends on 2 or 3 parts all moving together when I change a sketch expression (or attempting to atleast). If it is possible, what is the proper syntax to use for the above example?

I've always just manually adjusted all the parts when we do assemblies like this, but it would be pretty neat to automate the process a little.

thanks a lot.

 

RE: Can UG handle variable/automated expressions?

If you have Pro/E experience, the expression editing can be done in NX, but it is different from how you do it in Pro/Program.
You can do what you want with GRIP or Knowledge Fusion.
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Can UG handle variable/automated expressions?

No problem.  See the attached NX 5.0 part file (go to the Expression dialog).  However, you never told us what you wanted to do if P1 is exactly 0.50mm.  So I wrote the expressions assuming that the logic is: IF P1 is equal to OR greater than 0.50mm, P2 equals 35mm.  IF P1 is less than 0.50mm, P2 equals 5mm.

Anyway, take a look.  It should be east to figure out once you've seen it done once.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Can UG handle variable/automated expressions?

(OP)
Outstanding, John. Once again, your help is invaluable. I cannot thank you enough. I'm sure this will impress our customers as well lol

thanks for the help aswell looslib, I appreate you taking the time to respond

RE: Can UG handle variable/automated expressions?

John, can you do the same in an NX4 part?
 

"Wildfires are dangerous, hard to control, and economically catastrophic."

Ben Loosli

RE: Can UG handle variable/automated expressions?

For the record, the IF statement was added to the Expression system in NX 3.0 when we introduced 'Design Logic', which included, among other things, a major enhancement of the Expression system.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Can UG handle variable/automated expressions?

Speaking of Design Logic, in my notes from PLMworld 2005, I have reference to Engineering Handbook type functions that are built into Design Logic (expressions) from your demonstration John.  How do you access these functions?  I assumed it includes calculations like these:  http://www.mitcalc.com/

RE: Can UG handle variable/automated expressions?

You can access those functions from within the Expression system by going to the bottom of the dialog and selecting the button with the f(x) label.  What you will find there are several categories of functions, which include items you're probably already using such as pi() and the various trig functions.  Note that this is not all that different than accessing the 'Formulas' option in Excel, only we've included more engineering related functions, which are really predefined KF routines.  Many of these were taken directly from popular Engineering references such as Roark's 'Formulas for Stress and Strain' and others.

Now as for MITCalc, it would appear that what we've done in NX is somewhat similar, just not as comprehensive or as diversified.

However that being said, we are soon going to provide an interface to a 3rd party 'engineering solver', which will be integrated into the NX Expression system.  For NX 7.5, we are going to provide an integrated two-way portal between NX and the technical computing software package, 'Maple 13', from Maplesoft, Inc.

For some details as to what this will mean and what our expectations are, please go to:

http://www.maplesoft.com/company/publications/articles/view.aspx?SID=33859

And for more information about 'Maple 13' itself, go to:

http://www.maplesoft.com/products/Maple/features/index.aspx

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Can UG handle variable/automated expressions?

(OP)
Ok, John, I tried the equation that you gave and it's giving me an error.

I believe this is because I'm mixing angles and lengths. P1 (in the example) is an angle where P2 represents a length (component offset distance). So essentally what I'm looking for is when the angle of two parts is less than 0.5 degrees, another part sets it's offset accordingly.

The exact error it gives is:

"Error

  Dimension mismatch (binary operation)

  Attempt to use the ">=" opperation on Angle and Length.
  Expression:
  p32=IF(P44>=.5)(1.25)else(13.25)"


Any ideas on how to correct this? I changed the example you gave to apply it to our actual project. I should note (not sure if it makes a difference though) that P32 is controlled by a sketch that acts as a mating "skeleton" for the assembly. P44 is a regular "named" expression.

thanks

RE: Can UG handle variable/automated expressions?

Attached is a modified version of my original example.  What you do in a case like that is create an intermediary Expression which has the 'Dimensionality' of 'Constant' and use it instead in the final expression.  This will 'insulate' the Units of first expression from the Units of the second yet still give you the correct results.  You will see what I mean when you look at the part file.

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

RE: Can UG handle variable/automated expressions?

(OP)
outstanding, thanks john. I had originally tried that but got an error (noticed you had P3 set as 'constant' under units). We changed that and now it works great.


thanks again for all the help. It's appreciated

RE: Can UG handle variable/automated expressions?

Yes, there are times when using a 'Constant' expression in logic statements makes much more sense.  In this case, as I said, it tends to 'insulate' Expressions using one of set of units from Expressions using another.  

John R. Baker, P.E.
Product 'Evangelist'
Product Design Solutions
Siemens PLM Software Inc.
Industry Sector
Cypress, CA
http://www.siemens.com/plm
http://www.plmworld.org/museum/

To an Engineer, the glass is twice as big as it needs to be.
 

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