Cancel
Showing results for 
Search instead for 
Did you mean: 

Numeric expressions driven by attributes

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi

 

I'm creating a drawing template in NX12 and I want to include tolerances in a title block that are assigned based on picking a certain tolerance band. so for example I would have Fine (A) Medium (B) and Coarse (C) tolerances, when I create the drawing border, I'd like to be able to pick one of these of a list of values and this in turn would populate other cells in the title block with the values of the the tolerances. 

 

E.g

 

 Tolerance                   0 to 50mm         50mm - 150mm    150mm - 500mm

 

Tol grade A:              +- 0.05mm              +-0.15mm                   +-0.25

Tol grade B:              +- 0.15mm              +-0.25mm                   +-0.5

Tol grade C:              +- 0.25mm               +-0.5mm                    +-0.75

 

So the first column (tolerance) would be selected or entered by the user either during populating the title block or as a mandatory attribute and the numeric values would automatcally populate the title block.

 

There's plenty of attribute stuff I've found when searching but I can't find anything that relates to what I'm trying to do. Any help woud be appreciated.

 

Cheers

 

Si=

13 REPLIES

Re: Numeric expressions driven by attributes

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

You can do this with list expressions.

The tricky bit will be setting the expression to use as the index.

Easy in the Expression dialog, I'm not sure how to do elsewhere (other than writing a journal/API with a dialog)

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Numeric expressions driven by attributes

Siemens Honored Contributor Siemens Honored Contributor
Siemens Honored Contributor

Hi @Si_Wright,

 

@Ken_As suggestion works - though without any additional API the user will need to know that the Tolerance options are "A", "B" and "C" (and that they have to include the quotes).  Here are the expressions I defined and then pointed the text in the title block to the expressions (using the Relationships option on the Note dialog):

 

Screenshot - 6_21_2018 , 10_46_47 AM.png

 

 

I edited the OOTB title block and added "TOLERANCE" and "0 to 50mm" to the last two fields. 

 

Screenshot - 6_21_2018 , 10_48_49 AM.png

 

Using the "Populate Title Block" command, you can replace "A" with "B" or "C" and the "0 to 50mm" field updates (see attached).  It would be nice if the Populate Title Block dialog had the ability to show a pull down menu - existing ER 7942358.

 

Regards, Ben

Re: Numeric expressions driven by attributes

Solution Partner Pioneer Solution Partner Pioneer
Solution Partner Pioneer

Hi @BenBroad and @Ken_A

 

I managed to do it using the technique shown in the attached video. There are some mandatory attributes that have to be filled in when ever a new part is created, so it would make sense that this attribute in included in the list of manadatory attributes.

 

Thanks for your input. Much appreciated.

 

Si

Highlighted

Re: Numeric expressions driven by attributes

Siemens Honored Contributor Siemens Honored Contributor
Siemens Honored Contributor

Nice job @Si_Wright - and a good use of Attribute Templates to create the drop-down list of values.

 

A quick movie showing how to set this up for anyone following the thread:

 

(view in My Videos)

 

Regards, Ben

Re: Numeric expressions driven by attributes

Pioneer
Pioneer

@BenBroad

How does this work for when you create a new part and then add the same template border to that? I can get the attribute to work properly, but the expressions change. Is there a setting I am missing to keep these consistent when creating new parts?

Re: Numeric expressions driven by attributes

Siemens Honored Contributor Siemens Honored Contributor
Siemens Honored Contributor

Hi @Taylor8,

 

You must be importing the template, which is adding an index to the expressions.  The solution I showed above assumes that you're using the templates that were installed with NX when creating new part files.  That said, if you're importing the templates and their expressions are assigned an index, any annotation that references the expression should update to read the indexed expression.

 

If you can give us a little more information we can try to help.

 

Regards, Ben

Re: Numeric expressions driven by attributes

Pioneer
Pioneer

@BenBroad

Thank you for your response. That seems to be exactly what is happening, the expressions are adding an index. I created a custom template border with similar attributes for the tolerance block as described in the thread above (using attribute and expressions).

 

When I create a new part and then go to "Drafting" and add the custom template border the expressions add an index. Is the proper way to go about this to create a new drawing and then go to "Modeling" instead? This seems to keep the expressions as I want them.

 

Thanks for you help!

Taylor

Re: Numeric expressions driven by attributes

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

"When I create a new part and then go to "Drafting" and add the custom template border..."

 

What exactly do you mean by "adding the custom template border" to the new part, what steps do you take to do this?

 

If you are creating a new file then using 'file - import' to bring in the drawing template: this may be causing the issue you see.

 

The recommended way of working is to set up the drafting template file (with the desired title block and border); then, in the 'file - new' menu, create a new drawing file (specify your template) and tell it to reference your model file (or add your model as a component of the drafting file manually after it is created). This will create a 'master model' drawing with your desired drawing template that references your part.

Re: Numeric expressions driven by attributes

Pioneer
Pioneer

@cowski1

I start by creating a new model(File > New > Model). Then after I create the model, I click on Application > Drafting. This prompts the "Sheet" feature to appear. Then I click on "Use Template" and select the custom template border I created.

 

 

If I create the drawing file first (File > New > Drawing) and then add the model as a component of the drawing file manually after it is created, then the rest of the title block doesn't populate the model information (Title, Drawing number, etc.). It shows the drawing information. (In this case I can't name them the same thing thing since I am working with Teamcenter.)