please_dont_crash
Automotive
- Apr 21, 2020
- 25
NX version 1973, integrated with TC.
I'm hoping someone can point me in the right direction. I'm pretty new to NX so there may be some fundamental misunderstandings about how things work here, but I hope this is clear enough:
Part setup:
-- DatumCSYS at part absolute origin, that stays fixed.
-- Multiple other DatumCSYS whose position is defined via "Offset CSYS" from the absolute origin DatumCSYS via expressions. When the expression editor is opened, it contains a list of expressions along the lines of:
Desired functionality:
-- The various non-absolute-origin DatumCSYS can be moved around via dynamic positioning (i.e. with the mouse and handles). When they are moved, the expressions in the expression editor update to reflect the new offset values.
-- These expressions and their values can be written to an Excel file in Teamcenter.
-- The Excel file can be manually edited and these new values can then be assigned to the expressions, resulting in the various DatumCSYS moving to new locations.
I hope that's clear enough.
My work so far, covering possible approaches:
1) I've looked into using ug_cell_read() when entering the translation/rotation values for each DatumCSYS. I see that from there, I can specify an Excel spreadsheet in Teamcenter. This gives me the impression that I can only read data from the Excel file, but not move the DatumCSYS dynamically and then write out the new data to that Excel file.
2) I have also looked at the Spreadsheet functionality. I suspect this might be closer to what I want. But I am still trying to learn if the spreadsheet can be accessed as a stand-alone file (without doing a Save Copy As), and I don't think it can. I'd like to avoid things like copy-pasting into and out of the Spreadsheet window.
3) A third option (and honestly it's looking like I might go this route, because it is the simplest) is to give up on the spreadsheet idea altogether, and just use the Import Expressions/Export Expressions to save and load text files containing expressions and their values. I can always write a glue script to move these to and from whatever Excel file I am working with. With this approach, the only thing to determine is if I can indeed move the various DatumCSYS dynamically and have the expressions update with new values. I think this is the case.
Thoughts and suggestions appreciated!
I'm hoping someone can point me in the right direction. I'm pretty new to NX so there may be some fundamental misunderstandings about how things work here, but I hope this is clear enough:
Part setup:
-- DatumCSYS at part absolute origin, that stays fixed.
-- Multiple other DatumCSYS whose position is defined via "Offset CSYS" from the absolute origin DatumCSYS via expressions. When the expression editor is opened, it contains a list of expressions along the lines of:
Code:
datumcsys_1_x = <value>
datumcsys_1_y = <value>
datumcsys_1_z = <value>
datumcsys_1_angle1 = <value>
datumcsys_1_angle2 = <value>
datumcsys_1_angle3 = <value>
datumcsys_2_x = <value>
...
Desired functionality:
-- The various non-absolute-origin DatumCSYS can be moved around via dynamic positioning (i.e. with the mouse and handles). When they are moved, the expressions in the expression editor update to reflect the new offset values.
-- These expressions and their values can be written to an Excel file in Teamcenter.
-- The Excel file can be manually edited and these new values can then be assigned to the expressions, resulting in the various DatumCSYS moving to new locations.
I hope that's clear enough.
My work so far, covering possible approaches:
1) I've looked into using ug_cell_read() when entering the translation/rotation values for each DatumCSYS. I see that from there, I can specify an Excel spreadsheet in Teamcenter. This gives me the impression that I can only read data from the Excel file, but not move the DatumCSYS dynamically and then write out the new data to that Excel file.
2) I have also looked at the Spreadsheet functionality. I suspect this might be closer to what I want. But I am still trying to learn if the spreadsheet can be accessed as a stand-alone file (without doing a Save Copy As), and I don't think it can. I'd like to avoid things like copy-pasting into and out of the Spreadsheet window.
3) A third option (and honestly it's looking like I might go this route, because it is the simplest) is to give up on the spreadsheet idea altogether, and just use the Import Expressions/Export Expressions to save and load text files containing expressions and their values. I can always write a glue script to move these to and from whatever Excel file I am working with. With this approach, the only thing to determine is if I can indeed move the various DatumCSYS dynamically and have the expressions update with new values. I think this is the case.
Thoughts and suggestions appreciated!