Showing results for 
Search instead for 
Do you mean 
Reply

Save a value in the NX session

Hi,

 

I want to change the work layer before entering the dimension function to layer 22 so that all dimensions are created on layer 22. For that I use the menuscript: ACTIONS/PRE set-worklayer-22.dll. In this dll I want to save the actual work layer in the NX session for a reset function I want to call with the post action of the dimension function.

My first idea is to use an environment variable and use the SetEnvironmentVariableValue and GetEnvironmentVariableValue functions. Does anyone know a better way?

 

Thanks

Stefan

 

Mit freundlichen Grüßen / With kind regards

i.A. Dipl.-Ing. (FH) Stefan Walder
CAD Management
----------------------------------------------------------------------
stefan.walder@gira.de
Tel +49(0)2195-602-319, Fax +49(0)2195-91603-319
----------------------------------------------------------------------
Gira Giersiepen GmbH & Co. KG, Elektro-Installations-Systeme
Industriegebiet Mermbach, Dahlienstraße, 42477 Radevormwald, Deutschland

Intelligente Gebäudetechnik von Gira. www.gira.de

Handelsregister AG Köln HRA 16352
Persönlich haftende Gesellschafterin: GAV Management GmbH,
Handelsregister AG Köln HRB 50479
Geschäftsführer: Dipl.-Kfm. Dirk Giersiepen, Alfred A. Bulitz,
Dipl.-Kfm. Thomas Musial
----------------------------------------------------------------------
Gira Giersiepen GmbH & Co. KG, Electrical installation systems
Industriegebiet Mermbach, Dahlienstraße, 42477 Radevormwald, Germany

Intelligent building technology by Gira. www.gira.com

Register of Business Names: AG Köln HRA 16352
Partner Personally Responsible: GAV Management GmbH,
Register of Business Names: AG Köln HRB 50479
Managing Directors: Dipl.-Kfm. Dirk Giersiepen,
Dipl.-Wirtschafts-Ing. (FH) Oliver Borchmann, Alfred A. Bulitz,
Dipl.-Kfm. Thomas Musial
6 REPLIES

Re: Save a value in the NX session

Why not set an attribute with the previous layer? Just in case you have two NX sessions running and you start dimensioning.With an attribute you will be certain that you can jump back to a layer that was used before.
W10 NX11.0.1

Re: Save a value in the NX session

I

 

don't want to use a part attribute because I don't want to take affort in deleting the attribute when I don't need it anymore.

I want to use a place in the session context to save information for later user in an other dll.

The environment variable works but I'm not sure if there is a better way to do it.

 

Thanks

Stefan

 

Mit freundlichen Grüßen / With kind regards

i.A. Dipl.-Ing. (FH) Stefan Walder
CAD Management
----------------------------------------------------------------------
stefan.walder@gira.de
Tel +49(0)2195-602-319, Fax +49(0)2195-91603-319
----------------------------------------------------------------------
Gira Giersiepen GmbH & Co. KG, Elektro-Installations-Systeme
Industriegebiet Mermbach, Dahlienstraße, 42477 Radevormwald, Deutschland

Intelligente Gebäudetechnik von Gira. www.gira.de

Handelsregister AG Köln HRA 16352
Persönlich haftende Gesellschafterin: GAV Management GmbH,
Handelsregister AG Köln HRB 50479
Geschäftsführer: Dipl.-Kfm. Dirk Giersiepen, Alfred A. Bulitz,
Dipl.-Kfm. Thomas Musial
----------------------------------------------------------------------
Gira Giersiepen GmbH & Co. KG, Electrical installation systems
Industriegebiet Mermbach, Dahlienstraße, 42477 Radevormwald, Germany

Intelligent building technology by Gira. www.gira.com

Register of Business Names: AG Köln HRA 16352
Partner Personally Responsible: GAV Management GmbH,
Register of Business Names: AG Köln HRB 50479
Managing Directors: Dipl.-Kfm. Dirk Giersiepen,
Dipl.-Wirtschafts-Ing. (FH) Oliver Borchmann, Alfred A. Bulitz,
Dipl.-Kfm. Thomas Musial

Re: Save a value in the NX session

What would be a better way?

 

Using the environment variable you would not know if the current layer is the previous one, if your dialog crashes, if you don't clear it afterwards either.

 

Both ways are working in a similar way and both exhibit the problem of how to determine if the layer must be saved or not, when run after the dialog crashed.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community

Re: Save a value in the NX session

Some other alternatives would be to write the info to a file in the user's temporary folder or write the info to the registry. I'm not sure that either of those options would be "better" than what you are doing now, though.

 

Re: Save a value in the NX session

If you are in a part file, could you use an expression - previous_layer=22 ?

 

Mark Rief
Retired Siemens

Re: Save a value in the NX session

The problem with external files is that they can get deleted.

We do have a policy to clear the temporary folder when the user logs off, for example.

 

Best way to keep information between sessions is to use attributes, they are easy to create and check.

Stefan Pendl, Systemmanager CAx, HAIDLMAIR GmbH
Production: NX10.0.3, VERICUT 8.0, FBM, MRL 3.1.4 | TcUA 10.1 MP7 Patch 0 (10.1.7.0) | TcVis 10.1
Development: VB.NET, Tcl/Tk    Testing: NX11.0 EAP, NX12.0 EAP

How to Get the Most from Your Signature in the Community