Cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate a table with dimension values

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Hello!

 

Since I have no experience with programming, I would kindly ask, if someone can help me with automating one table.

 

Below is the description of what should macro do (see also the attached drawing file):
1. on a drawing, some dimensions are marked as Inspection dimensions.
2. those dimensions should be collected in one table, that is also in this same drawing
3. now, macro should find out the number of inspection dimensions. According to this, the table should have so many rows. Rows should be added below the last row.
4. in every row of this table, Sequence number should appear (1,2,3,4, etc.).
5. Type of CTQ can remain empty.
6. in the Dimension column (CTQ section), macro should write all the inspection dimensions
7. in tolerances (CTQ section), macro should write all the tolerances of the appropriate dimension.
8. Production Tolerances section can remain empty.

 

So in short, macro should collect all the inspection dimensions and write their values in appropriate columns/cells in the table.

 

Macro can be executed in different ways (whatever is easier):
1. user can place the table on a drawing. Then the table is selected and macro is executed
2. macro is executed and then the user selects the table (already placed) and the table is populated with those dimensions.
3. macro is executed and now macro creates a tabl and populates the table with appropriate dimensions
etc.

 

I have attached the model file and a dawing file. In a drawing file, you can see, that there are 4 inspection dimensions. There is also a table, that should be populated with those 4 dimensions.
The files are created in NX8.5, so I would really appreciate, if the macro can be reated for NX8.5.

 

Thanks.
Best Regards,
Danilo

8 REPLIES

Re: How to populate a table with dimension values

Legend
Legend

As a first look at this I found that to do this directly as a journal can only be done with NX9 or later.  The reason for this is that the EditSettingsBuilder class was only implemented  with NX9.  Now it is possible to do it in NX8.5 if we can do something to identify the inspection dimensions.  Maybe something as simple as a dimension object name would work.

 

Frank Swinkels

Re: How to populate a table with dimension values

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Hello Frank,

 

I guess, that naming those dimensions would give additional work to our engineers, so they would not be to happy with that. Smiley Happy

Anyway, since we are planning a migration to NX10 later this year, such a macro can be done also in NX9 or NX10.

 

Thanks for helping me out with this.

Regards.

Re: How to populate a table with dimension values

Honored Contributor
Honored Contributor

@FrankSwinks,

Why would the EditSettingsBuilder be required?

Re: How to populate a table with dimension values

Honored Contributor
Honored Contributor

Here's my take on it. The journal works with NX 8.5.

On the first run it will ask you to select the dimension tabular note; it will add an attribute to the note so that it can be found automatically on subsequent runs. Each inspection dimension will be reported in the tabular note; each will be given a "sequence number" attribute where the value matches the one shown in the table. On subsequent runs of the journal, existing dimensions will be updated, new ones will be added.

 

It isn't heavily tested, if you run into any issues, post back.

 

Inpsection dimension tabular note

Highlighted

Re: How to populate a table with dimension values

Legend
Legend

I guess I don't do enough drafting programming.  I was unaware of the dimension class property of InspectionDimensionFlag.

 

Thanks for that.

 

Frank Swinkels

Re: How to populate a table with dimension values

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Thanks for this journal. I have already tested and it works just fine.

 

I have only two requests, if it is not to much:

1. the table is populated with those inspection dimensions. Then, this table is deleted. When I place new table on this drawing, the journal is not working anymore. So, I can not populate new table with those dimensions. It would be great, if I can populate new table, if one is removed.

2. The inspection table is already created. Now I remove Inspection symbol from one dimension. If I run this journal again, the dimension remains in the table. It is not removed. It would be great, if the old dimension is removed from the table and all the other dimensions are renumbered.

 

I would appreciate, if this can be done, too.

Thanks for all the help so far.

Best Regards.

Re: How to populate a table with dimension values

Honored Contributor
Honored Contributor

The journal has been updated - same link as above.

Re: How to populate a table with dimension values

Solution Partner Valued Contributor Solution Partner Valued Contributor
Solution Partner Valued Contributor

Hello!

 

Thanks a lot for all your help and for creating this macro. It works perfectly now.

 

Best Regards.