×
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

Drive expression by component name?
2

Drive expression by component name?

Drive expression by component name?

(OP)
In an assembly, is it possible to drive an expression based on what a certain component name is?

Basically I use an expression to control a mate dimension. I want to change the value automatically based on which family component is inserted. So:

if component="Liner, 32mm", then mate dimension = 1, etc...

Jason

RE: Drive expression by component name?

Jason,

I think it would be easier to have an expression that controls the configuration ie configuration=1

Then have conditional expressions for the mating distance based on the value of "configuration".

You may also have component suppression expressions that are conditional based on the "configuration" expression.




Jonathan T. Schmidt
http://www.schmidtmotorworks.com

RE: Drive expression by component name?

(OP)
Are you saying control the family member selection by expression? What syntax does that, I see nothing in help.

Jason

RE: Drive expression by component name?

Hi,
the suppression by expression can be found in the Assembly menu. The syntax for conditional expressions is a bit strange and should be something like: if(<condition>) then <param>=<value>. I don't remember it exactly now, but I've got a Design Visionaries book which explains it. If you're stil interested in that topic, I'll have a look and post it there.

Regards

RE: Drive expression by component name?

(OP)
I don't see a suppress by expression option under the assembly menu. There is one under the Edit/Features menu but it looks like it only works for features. If you can post an example of this, I'd appreciate it.

What I can't find is how UG distinguishes different instances of a component in the tree. Like if I insert a file "Bolt" twice, but I only want to suppress one of them by an expression. They both have the exact same name in the tree. Solidworks shows an instance number so you can tell the difference between multiple instances of the same part in your assy. UG has to have something similar.


Jason

RE: Drive expression by component name?

Hi Jason,

I'm sorry that I can't post anything useful right now, because I haven't got my book here, I'll be able to look into it only on Friday evening or Saturday.
I'm sure you can suppress by expression in some way, what I don't remember is if / how we can distinguish between several different istances.

I'll let you know as soon as possible.

Regards!

RE: Drive expression by component name?

Hi Jason,

you're right, I mixed up some things. So, correct answers are:
1-Conditional expression: syntax is: param_name=if(condition)0 else 1
where "condition" is a statement such as dim_1<=20 and the values before and after "else" can be any values, of course, or even expressions. In this last case, syntax is:
param=if(condition) (expre_true) else (expr_false).
2-Suppress by Expression is related to features. The command is accessed from Edit/Feature/SbE. From th dialog, you then have to select the feature's element to which the conditional expression will be related (ex: the center of a hole). Then, go to Tools/Expressions and look for the new expression added which looks like "p(x)=1". Then add a "switch" parameter such as switch=if(L>=300)1 else 0. Then modify the expression for p(x) by giving p(x)=switch.
3-Expression inside assembly's parts: you have to enable "interpart operation". After that, a parameter expression related to a component has this syntax:
component_name::parameter_name=value_or_expression. In order to distinguish between instances, the way I know is to assign a slightly different name to each.
4-I fear that in order to create several assemblies with different suspended/unsuspended components, you can't command this through the expr editor but you have to use Contexts. In this, I was too optimistic when I said that you could suspend a COMPONENT by expression... Please note anyway that I have very little experience with assemblies in UG. Also, I fear the conditional expression based upon the component NAME doesn't work: as far as I know there is no explicit function in the expr editor to recall the internal database field "comp_name".

Sorry, I hope that the few above things can be useful anyway...

Regards

RE: Drive expression by component name?

2
Hi Jason, cbrn

You can suppress a component by an expression by right clicking on the component you want to suppress in the "Assembly Navigator", and then choosing "Suppression". The dialog that will appear will you give you the option to suppress by expression.

Regards

RE: Drive expression by component name?

(OP)
There is is, thanks, I knew there had to be a way......have a star on me.

Jason

RE: Drive expression by component name?

I dont find "suppression" option after right clicking on a component in "assembly nevigator".
I am using Unigrphics NX2 ,
Does this function exists in NX2?

RE: Drive expression by component name?

(OP)
Right Click it and go to "Properties". Then select the "Parameters" tab. There is the supression options "Controlled by Expression".

Jason

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