cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

mapkey to delete log files during dxf export

thlavinka
1-Newbie

mapkey to delete log files during dxf export

Hello,

 

I would like to get rid of log files generated during dxf export.

I found a PROE discusion where there is a mapkey created for this purpose: mapkey(continued) @SYSTEMdel c:\\proe_dir\\*_dxf__out.*; but it does not work for me.

Also I dont know how to change the path to my current working directory.

 

the whole mapkey looks like following:

 

mapkey dxf @MAPKEY_NAMEExport do DXF;@MAPKEY_LABELDXF;\

mapkey(continued) ~ Command `ProCmdEnvHidden` 1;~ Command `ProCmdModelSaveAs`

mapkey(continued) ~ Open `file_saveas` `type_option`;~ Close `file_saveas` `type_option`;\

mapkey(continued) ~ Select `file_saveas` `type_option` 1 `db_137`;\

mapkey(continued) ~ Activate `file_saveas` `OK`;~ Activate `export_2d_dlg` `OK_Button`;\

mapkey(continued) ~ Activate `UI Message Dialog` `ok`;

mapkey(continued) @SYSTEMdel c:\\proe_dir\\*_dxf__out.*;

 

thanks for help in advance

 

T.


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
1 ACCEPTED SOLUTION

Accepted Solutions

Tomas,

mapkey cannot work, because it removes files from c:\proe_dir directory.

Your working directory is c:\Users\hlavinka\Documents\473-4430\2, try the following mapkey.

mapkey ddd @MAPKEY_LABELDelete dxf logs;\

mapkey(continued) @SYSTEMdel c:\\Users\\hlavinka\\Documents\\473-44\

mapkey(continued) 30\\2\\*_dxf__out.*;

The mapkey is not universal !!!

Martin Hanak


Martin Hanák

View solution in original post

13 REPLIES 13

Tomas,

mapkey ddd @MAPKEY_LABELDelete dxf logs;\

mapkey(continued) @SYSTEMdel c:\\proe_dir\\*_dxf__out.*;

ddd ... mapkey key sequence

c:\\proe_dir ... corresponds with c:\proe_dir (in mapkey you have to used doubled backslashes)

The length of mapkey line must not exceed 80 characters. If the path to your working directory is long, then you have to split second line into two ones.

Martin Hanak


Martin Hanák

Hi Martin,

I tried it and seems it does not work

1.jpg

Tomas,

mapkey cannot work, because it removes files from c:\proe_dir directory.

Your working directory is c:\Users\hlavinka\Documents\473-4430\2, try the following mapkey.

mapkey ddd @MAPKEY_LABELDelete dxf logs;\

mapkey(continued) @SYSTEMdel c:\\Users\\hlavinka\\Documents\\473-44\

mapkey(continued) 30\\2\\*_dxf__out.*;

The mapkey is not universal !!!

Martin Hanak


Martin Hanák

OK, now it works. Does it mean there is no other way except changing the path (c:\\Users\\hlavinka\\Documents\\473-44\) always when the working directory is changed?


thanks

TomU
23-Emerald IV
(To:thlavinka)

The system window automatically opens up in the current working directory, so you should be able to eliminate the whole path part.

mapkey ddd @MAPKEY_LABELDelete dxf logs;\

mapkey(continued) @SYSTEMdel *_dxf__out.*;

MartinHanak
24-Ruby II
(To:TomU)

It works!


Martin Hanák
thlavinka
1-Newbie
(To:TomU)

on my PC it does not work 😞

Please upload config.pro containing mapkey. I can test it on my PC.


Martin Hanák

So I have doublechecked it and it really works, thanks wery much!

tleati
10-Marble
(To:TomU)

Hi Tom,

I am trying to do the same thing on our system. If I want to delete them in a subfolder of the working directory, could I do it with a line like this?:

mapkey(continued) @SYSTEMdel \\Subfolder\\*_dxf__out.*;

where Subfolder is the name of the working directory subfolder in which I always print out dxfs.

It would be very comfortable, because If I instead put the entire directory like "C::\\ etc etc" it wouldn't be universal and so not valid for all company users.

(I wouldn't try before knowing not to make damages).

thanks

tleati
10-Marble
(To:tleati)

Already solved!

for the interest who will end up in this topic...for me it works just by inserting this line:

mapkey(continued) @SYSTEMdel subfolder\\*_dxf__out.*;

where subfolder is the name of the working directory subfolder in which I want to delete del dxf_out files.

Same applies to steps log files:

mapkey(continued) @SYSTEMdel subfolder\\*__out.log.*;

There is a variable for the working directory that you can use in a mapkey, but I can't find it now. I saw it in an email from the old PTC User list, but I can't find it in my archives right now.

I think that when you call a system window, it opens in your working directory. So if you create a batch file that contains "del *_dxf__out.*", and call it from your mapkey, I believe it will operate in your working directory.

--
Doug Schaefer | Experienced Mechanical Design Engineer
LinkedIn

Tom & were typing at the same time. His method is simpler.

--
Doug Schaefer | Experienced Mechanical Design Engineer
LinkedIn
Top Tags