Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

[?] How to add revsion to filename?

jstiles

New member
I currently have a macro that will cycle thru all the sheets in my drawing and save each sheet as a DXF (such as 123456_1.dxf) but I would like to note the revision at the end of the file name (such as 123456_1_rev4.dxf). Is there a way to suck the revision (&rev_level)out of the drawing and add it to the end of the file name?


My mapkey is below for reference. I loop it using another mapkey. Which actually calls for another question...Is there a way to get the mapkey to loop itself based on the number of sheets in the drawing using the variable &total_sheets? That way I wouldn't have to re-write my master macro to loop the macro below based on the number of sheets in the drawing.
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>


mapkey dxf ~ Select `main_dlg_cur` `MenuBar1`1 `File`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `File.psh_save_as`;\
mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\
mapkey(continued) ~ Select `file_saveas` `type_option`1 `db_137`;\
mapkey(continued) ~ Open `file_saveas` `ph_path.Path`;~ Close `file_saveas` `ph_path.Path`;\
mapkey(continued) ~ Select `file_saveas` `ph_path.Path`1 `c:`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist`1 `users`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist`1 `users`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist`1 `jstiles`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist`1 `jstiles`;\
mapkey(continued) ~ Select `file_saveas` `ph_list.Filelist`1 `DXF's`;\
mapkey(continued) ~ Activate `file_saveas` `ph_list.Filelist`1 `DXF's`;\
mapkey(continued) ~ Activate `file_saveas` `OK`;\
mapkey(continued) ~ Select `export_2d_dlg` `Splines_Group`1 `as_polylines`;\
mapkey(continued) ~ Activate `export_2d_dlg` `OK_Button`;~ FocusIn `UI Message Dialog` `ok`;\
mapkey(continued) ~ Activate `UI Message Dialog` `ok`;\
mapkey(continued) ~ Select `main_dlg_cur` `MenuBar1`1 `View`;\
mapkey(continued) ~ Close `main_dlg_cur` `MenuBar1`;\
mapkey(continued) ~ Activate `main_dlg_cur` `View.psh_view_goto_sheet`;\
mapkey(continued) ~ FocusOut `gotosheet` `InpPagenum`;~ Activate `gotosheet` `Next`;\
mapkey(continued) ~ Activate `gotosheet` `Close`;</BLOCKQUOTE>
 
I've created a mapkey to append the revision,it's not easy but it can be done. You need to export a text file of the part parameters via mapkey, then create a batch file that will parse the exported text file for the revision, capture the value and then rename the exported DXF with the rev value at the end.
 
dgs said:
I've created a mapkey to append the revision,it's not easy but it can be done. You need to export a text file of the part parameters via mapkey, then create a batch file that will parse the exported text file for the revision, capture the value and then rename the exported DXF with the rev value at the end.


Could you post the code from your mapkey and batch file or e-mail it to me at jstiles at speedlinetech dot com?
 
Perhaps, I'm off to a meeting right now. However, our batch files and mapkeys are pretty specific and do quite a bit more than the rename, I'm not sure that it'd be easy to re-interpret for your situation.

I'll try to remember to follow up later.
 
dgs said:
Perhaps, I'm off to a meeting right now. However, our batch files and mapkeys are pretty specific and do quite a bit more than the rename, I'm not sure that it'd be easy to re-interpret for your situation.

I'll try to remember to follow up later.


Any update?
 

Sponsor

Articles From 3DCAD World

Back
Top