Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Macro Dialogu Box

Status
Not open for further replies.

Jamziee

Mechanical
Sep 6, 2004
28
GB
Hi Guys,

I'm trying to create a Macro to simplify importing of DXF files.

When I record the macro, it records the EXACT file that I initially imported... but I want the macro to allow the user to select a different file.

IS THIS POSSIBLE?
Any ideas in how to allow this if it is possible?

I believe it has something to do with the "FILE_BOX" attribute in the Macro code, but have had no success with playing with the values after searching the UG help files.

The complete coding is as follows (the "FILE_BOX" attribute is about half way down the coding):

------------------------------------------------------
Unigraphics NX 2.0.2.2
Macro File: L:\USERS\jamesaw\JOBS\DIGITAL TEMPLATES\DXF_Import.macro
Macro Version 7.20
Macro List Language and Codeset: english 17
Created by jamesaw on Thu Jun 09 08:14:36 2005
Part Name Display Style: $FILENAME
Selection Parameters 1 2 0.230382 1
Display Parameters 1.000000 12.552288 7.847103 -1.000000 -0.625153 1.000000 0.625153
*****************
RESET
MENU, 0, UG_FILE_IMPORT_DXF UG_GATEWAY_MAIN_MENUBAR !
ASK_ITEM 3 (1 RADI 0) = 0 ! Work Part
DIALOG_BEGIN "Import DXF/DWG" 0
BEG_ITEM 3 (1 RADI 0) = 0 ! Work Part
END_ITEM 3 (1 RADI 0) = 0 ! Work Part
DIALOG_END 0, 1 ! Import DXF/DWG: Choose DXF/DWG File
FOCUS CHANGE IN 1
FOCUS CHANGE IN 1
FOCUS CHANGE OUT 1
FOCUS CHANGE IN 1
FILE_BOX -2, L:\USERS\jamesaw\JOBS\DIGITAL TEMPLATES\Ascent Knee Primary\179314.dxf L:\USERS\jamesaw\JOBS\DIGITAL TEMPLATES\Ascent Knee Primary\*.DXF 0 ! DXF/DWG File Name
ASK_ITEM 3 (1 RADI 0) = 0 ! Work Part
DIALOG_BEGIN "Import DXF/DWG" 0
BEG_ITEM 3 (1 RADI 0) = 0 ! Work Part
END_ITEM 3 (1 RADI 0) = 0 ! Work Part
DIALOG_END -2, 0 ! Import DXF/DWG: OK
FOCUS CHANGE IN 1
FOCUS CHANGE IN 1
MESSAGE_BOX -2, Drawings cannot be imported to the work part.
MESSAGE_TEXT Import to a new part if drawings are desired.
MESSAGE_TEXT
MESSAGE_TEXT Choose OK to continue the translation without importing any drawings.
MESSAGE_TEXT Choose Cancel to cancel the translation.
FOCUS CHANGE IN 1
MESSAGE_BOX -2, Import translation job submitted.
FOCUS CHANGE OUT 1
FOCUS CHANGE OUT 1
FOCUS CHANGE IN 1
FOCUS CHANGE IN 1
MESSAGE_BOX -2, Metric-English units conflict, automatically scaling part
MENU, 0, UG_FILE_SAVE_PART UG_GATEWAY_MAIN_MENUBAR !
--------------------------------------------------------

Hope you can help.

Many thanks,

Andy.


---------------------
Design Draughtsman
Biomet Ltd
 
Replies continue below

Recommended for you

Jamziee,

When you are creating your macro and you get to a point that you want the user to input something (what file to open). you can use the "User Entry" or "User Entry With Instroctions" at the point that you want them to pic something. The comand is under Tools -> Macro.

Jeremy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top