Determine, using a built-in expression system 'function', the name of the current Arrangement
Determine, using a built-in expression system 'function', the name of the current Arrangement
(OP)
Is there currently a built-in expression system function to query the name of the current Arrangement? As of Jan 2013, there was not, and this was discussed in this thread: http://www.eng-tips.com/viewthread.cfm?qid=337317
I would like to know if there is a better solution than that proposed in the thread: running VB journal code. I find this unsatisfactory since the code must be run to update the expressions each time the Arrangement is changed.
I would like to know if there is a better solution than that proposed in the thread: running VB journal code. I find this unsatisfactory since the code must be run to update the expressions each time the Arrangement is changed.





RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
There's actually a Check-Mate function (in the same Knowledge Fusion language used by the expressions system) that returns all of the information about the arrangements in the current work part. With a bit of finesse, this can be used within a string expression to return the name of the current arrangement, like this:
CODE --> Knowledge_Fusion
@{ $arr_info << mqc_askArrangementInformation(); $current_arr << Loop { For $a In $arr_info; If ( third($a) == TRUE ) Return second($a); }; }Put simply, this little bit of code loops through the list of arrangements and returns the name (string) of the "active" arrangement.
Now...
With that said, changing arrangements does not trigger a full model update in NX. As such, nothing triggers this expression to update if/when the arrangement is changed. Touching the formula of the expression [by adding or removing a space character at the end, for instance] and reevaluating it will get you an updated answer, but there's not an easy way to make that expression go through an update when the arrangement changes. Even consuming this expression in something like a PMI note doesn't quite get the job done.
And so yes... if you really need this arrangement name (and I'd still love to understand the larger workflow/dataflow in which you would consume it) then you'd want to be sure to include this update requirement in your ER.
Does that help a bit?
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
Also this could be used in the context of a Drawing of an Assembly if someone wanted to link the name of the current arrangement to say a note on the face of the Drawing or to a PMI notation.
As for the updating issue, I'll bet if you selected the 'Update for External Change' option from the 'Tools -> Update ->' menu that the arrangement name would update as well. Granted, this is a 'heavyweight' update as everything, including the feature tree in the model, will update, but it does seem to cover all situations as long as you can live with the time it may take to do a complete update.
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
I would like to model an assembly that has multiple configurations during operation, each one represented by a separate Arrangement. Further, I have parameterized components that change shape depending on the configuration (Arrangement). These are deformable in the sense that the shape changes, but the shape can not be determined from a measurement of endpoints as you might be able to do with a spring, but the shape is determined by the state which I can get from the particular Arrangement.
Triggering a model update upon changing the Arrangement would be a requirement in this case too.
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
This sounds like a creative solution and I would take it, but I am not aware that an arrangement can be triggered based on the value of an expression. Do you know otherwise?
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
For reference, "Tools --> Update --> Update for External Change" does in fact appear to kick this hard enough to cause the necessary update.
Unfortunately, the more convenient "Update Values from External Spreadsheet" button inside the Expressions dialog does not.
Both of the use cases you've described are interesting... Please make sure that you submit an ER for this.
Thanks!
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
The process you describe is something we can do quite easily with expressions driving parametric models. But this capability doesn't drive the NX "Arrangements" functionality, specifically.
It's quite common to drive any number of parametric updates (including model size and shape, feature suppression/unsuppression, assembly component positioning and/or suppression) based on a set of key expressions. One small step beyond that, it's also very simple to add a simple Product Template interface to present the user with those basic options in a well-labeled simple dialog format. But we would just call this "parametric modeling" or a "Product Template" and wouldn't use the "Assembly Arrangements" terminology, because that has a very specific meaning in the NX world.
But for the record, Product Template Studio *does* allow you to include an assembly arrangements option menu on a Product Template interface dialog.
Does that help at all?
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
I am beginning to think to abandon Arrangements altogether and take the approach you suggest as I have run into other difficulties. It seems that measurements are incompatible with Arrangements as they don't seem to update across Arrangements (ref http://www.eng-tips.com/viewthread.cfm?qid=280397). I need this, for example to query distances so I can set expressions.
Tell me, if I take your suggestion, is there a way for expressions to drive (suppress/unsuppress) constraints?
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
Ivan,
This sounds like a creative solution and I would take it, but I am not aware that an arrangement can be triggered based on the value of an expression. Do you know otherwise?"
There is (I was working in NX 8.5) but I do not remember it, it was three years ago when I used that function to set arrangements by expression values. I had three arrangements (A, B, C) and they where commanded by position along array. So 1=A 2=B 3=B 4=C 5=A ... and B could repeat two or three times based on user input in Product Template Studio.
I can't dig it out as I changed company and I do not have access to that model. Sorry.
PS. If you do not get answer here soon, I will try to contact my ex-colleagues and ask them, I think it would be useful to know that function for me too.
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
That would be a great Enhancement Request for Assemblies. And you would not be the first to request it.
And for the record, as one of the NX Product Managers, piling on *does* help.
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
IvanNX had a creative solution here... not entirely orthodox, but it works. I suspect he was borrowing the KF that PTS uses to change arrangements and using that in an expression formula. Again, that works, even though ew haven't officially exposed it in the Expressions dialog. That route might look something like this:
1. Create an expression to be the "index", or the driver of the choice (I used "Arr_choose" here.)
2. Create a conditional expression that looks at the "index" and chooses one of the existing arrangements based on that input (I used "ARR_set" here.)
Note that the "Type" of "Arr_set" is BOOLEAN. This is because the %ug_setAssemblyArrangement() function returns a Boolean. (Again, this is not a function we normally expose to customers through the Expressions dialog...)
The logic inside "ARR_set" looks like this:
CODE --> Knowledge_Fusion
Which should be fairly self-explanatory.
And so yes... That's another interesting option. Thanks, IvanNX.
Taylor Anderson
NX Product Manager, Knowledge Reuse and NX Design
Product Engineering Software
Siemens Product Lifecycle Management Software Inc.
(Phoenix, Arizona)
RE: Determine, using a built-in expression system 'function', the name of the current Arrangement
The last piece I need to make this work is to query and make use of measurements while changing arrangements. That is, as the arrangement changes, the relative positions of components change; some require updates based on the new configuration (e.g. a spring length must update based on some kinematic relationship that cannot easily be determined from an expression).
I note that measurements only work as expected in the default arrangement. If a measurement is created in the default arrangement and the arrangement is changed, the measurement does not update. Further, attempting to define measurements in the non-default arrangement results in unexpected results when this is attempted with moved components. Toggling the "default" arrangement doesn't solve it either as it just breaks the measurements as well.
Is there some other trick out there?