Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drive expression by component name? 2

Status
Not open for further replies.

J-C

Mechanical
Sep 8, 2003
1,066
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
 
Replies continue below

Recommended for you

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
 
Are you saying control the family member selection by expression? What syntax does that, I see nothing in help.

Jason
 
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
 
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
 
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!
 
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
 
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
 
There is is, thanks, I knew there had to be a way......have a star on me.

Jason
 
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?
 
Right Click it and go to "Properties". Then select the "Parameters" tab. There is the supression options "Controlled by Expression".

Jason
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor