Help Macro to open nc file in external program

Help Macro to open nc file in external program

nathanANTQX
Advocate Advocate
1,019 Views
5 Replies
Message 1 of 6

Help Macro to open nc file in external program

nathanANTQX
Advocate
Advocate

Hey Guys

 

I have an annoying issue with powermill, I am forever hitting view file in the right click menu causing my pc to hang while reading huge files. we always use an external nc editor to view and edit nc files.

 

Is there a way to edit the right click menu to remove re-order and view vile from the menu? 

 

Or is there a way to open selected nc files with a macro similar to the below for each loop? 

 

FOREACH $tp IN explorer_selected_entities() {
$TpName = $tp.Name
ACTIVATE TOOLPATH $TpName

.

.

.

}

 

(p.s. "For loop" is from my select and transform macro.)

Looking to be able to select nc files and hit the macro button to open the selected nc files in external editor.

 

kind regards Nathan

0 Likes
Accepted solutions (1)
1,020 Views
5 Replies
Replies (5)
Message 2 of 6

nathanANTQX
Advocate
Advocate
Accepted solution

DIALOGS ERROR OFF

STRING ncname = ""
STRING project_dir = ""
STRING file = ""
FOREACH ncp IN explorer_selected_entities() {
STRING ncname = ncp.Name
STRING project_dir = project_pathname(0)
STRING file = $project_dir + "/ncprograms/" + $ncname + ".nc"
OLE FILEACTION "OPEN" $file

}

 

opens any selected nc file, can be multiple

0 Likes
Message 3 of 6

hrh46
Advocate
Advocate

We use "cimco edit" for view and editing NC programs. Once it is installed, right clicking on each NC program ,"open in external program " opens g-code in cimco.

0 Likes
Message 4 of 6

nathanANTQX
Advocate
Advocate

We use HSM edit,  the macro allows you to select multiple nc files and open in HSM, instead of opening each one with right click, open in external program.

0 Likes
Message 5 of 6

kevin.hammond3WX4X
Advocate
Advocate

I prefer Notepad++ as my external editor, once you associate NC or tap files or whatever with notepad ++.

Also great for editing macros, there is a language file on here somewhere that colours the macros, making it easier to view than all black text.

0 Likes
Message 6 of 6

nathanANTQX
Advocate
Advocate

Hi Guys, so after using my macro for the last few months, I have discovered that it need some more tweaking.  I have found that the macro opens the nc file even if there was a change made, it opens the old written file in the project location. Is there a way to modify the code to check if the file is written, and if not write the file before opening the nc file in external editor?

 

Attached is the macro code:

 

 

DIALOGS ERROR OFF
STRING ncname = ""
STRING project_dir = ""
STRING filenc = ""
FOREACH ncp IN explorer_selected_entities() {
STRING ncname = ncp.Name
STRING project_dir = project_pathname(0)
STRING filenc = $project_dir + "/ncprograms/" + $ncname + ".nc"
OLE FILEACTION "OPEN" $filenc
}

 

0 Likes