Vann
Automotive
- Jan 27, 2004
- 8
Hello,
I am very new to UG. I am trying to write a macro in NX2 that will let me export a jpeg of a model and save it with the active model's filename.
Basically I want to open the .prt file, adjust it to the view I ant, then run my macro to save it in a directory with the rest of my jpegs.
I can't seem to find the proper syntax for inserting the active model's filename into the file dialog box during the macro.
Below is my macro so far. I left in the erronous parts so you can see what I am trying to do.
Unigraphics NX 2.0.3.1
Macro File: C:\Work\UG_COLOR_Pallette\ExportJPEG.macro
Macro Version 7.20
Macro List Language and Codeset: english 17
Part Name Display Style: $FILENAME
Selection Parameters 1 2 0.259128 1
Display Parameters 1.000000 14.048967 9.832908 -1.000000 -0.699903 1.000000 0.699903
*****************
RESET
MENU, 0, UG_FILE_EXPORT_JPEG UG_GATEWAY_MAIN_MENUBAR !
DIALOG_BEGIN "JPEG Image File" 0
BEG_ITEM 0 (1 WIDE 0) = &FILENAME ! JPEG File --- I want the active part name to display here
BEG_ITEM 3 (1 BOOL 0) = 0 ! Use White Background
EVENT VALUE_CHANGED -50 0, 3, 0, 0! Use White Background
ASK_ITEM 3 (1 BOOL 0) = 1 ! Use White Background
EVENT ACTIVATE -50 0, 1, 0, 0! Browse...
ASK_ITEM 0 (1 WIDE 0) = $FILENAME ! JPEG File
FILE_BOX -2, P:\Work\Jpegs\mat002_100_covinsert-aa.jpg P:\Work\Jpegs\*.JPG 0 ! JPEG Image File
ASK_ITEM 0 (1 WIDE 0) = "P:\Work\Jpegs\" & $FILENAME & ".jpg" ! JPEG File ---This is not working
END_ITEM 0 (1 WIDE 0) = "P:\Work\Jpegs\" & $FILENAME & ".jpg" ! JPEG File ---This is not working
END_ITEM 3 (1 BOOL 0) = 1 ! Use White Background
DIALOG_END -2, 0 ! JPEG Image File: OK
FOCUS CHANGE IN 1
I am familiar with VB and some other programming but I am not sure how (or if it is possible) to use variables in the macro.
Thanks in advance for any help.
I am very new to UG. I am trying to write a macro in NX2 that will let me export a jpeg of a model and save it with the active model's filename.
Basically I want to open the .prt file, adjust it to the view I ant, then run my macro to save it in a directory with the rest of my jpegs.
I can't seem to find the proper syntax for inserting the active model's filename into the file dialog box during the macro.
Below is my macro so far. I left in the erronous parts so you can see what I am trying to do.
Unigraphics NX 2.0.3.1
Macro File: C:\Work\UG_COLOR_Pallette\ExportJPEG.macro
Macro Version 7.20
Macro List Language and Codeset: english 17
Part Name Display Style: $FILENAME
Selection Parameters 1 2 0.259128 1
Display Parameters 1.000000 14.048967 9.832908 -1.000000 -0.699903 1.000000 0.699903
*****************
RESET
MENU, 0, UG_FILE_EXPORT_JPEG UG_GATEWAY_MAIN_MENUBAR !
DIALOG_BEGIN "JPEG Image File" 0
BEG_ITEM 0 (1 WIDE 0) = &FILENAME ! JPEG File --- I want the active part name to display here
BEG_ITEM 3 (1 BOOL 0) = 0 ! Use White Background
EVENT VALUE_CHANGED -50 0, 3, 0, 0! Use White Background
ASK_ITEM 3 (1 BOOL 0) = 1 ! Use White Background
EVENT ACTIVATE -50 0, 1, 0, 0! Browse...
ASK_ITEM 0 (1 WIDE 0) = $FILENAME ! JPEG File
FILE_BOX -2, P:\Work\Jpegs\mat002_100_covinsert-aa.jpg P:\Work\Jpegs\*.JPG 0 ! JPEG Image File
ASK_ITEM 0 (1 WIDE 0) = "P:\Work\Jpegs\" & $FILENAME & ".jpg" ! JPEG File ---This is not working
END_ITEM 0 (1 WIDE 0) = "P:\Work\Jpegs\" & $FILENAME & ".jpg" ! JPEG File ---This is not working
END_ITEM 3 (1 BOOL 0) = 1 ! Use White Background
DIALOG_END -2, 0 ! JPEG Image File: OK
FOCUS CHANGE IN 1
I am familiar with VB and some other programming but I am not sure how (or if it is possible) to use variables in the macro.
Thanks in advance for any help.