Get Op Tool Path: Difference between revisions

From Macros Wiki
Jump to navigationJump to search
ConnerO (talk | contribs)
No edit summary
ConnerO (talk | contribs)
No edit summary
 
Line 1: Line 1:
check part_open, "You must have a part open to run this macro"<br>
<br>
local i, inum, iop<br>
<br>
{|
{|
get_op_list 1      ||    ! get list of selected ops
|check part_open, "You must have a part open to run this macro"
|-
|&nbsp;
|-
|local i, inum, iop
|-
|&nbsp;
|-
|&nbsp;
|-
|get_op_list 1      ||    !&nbsp;&nbsp;&nbsp; get list of selected ops
|-
|inum=number_of_ops
|-
|if inum<1 then stop "Please select an operation"
|-
|&nbsp;
|-
|!&nbsp;&nbsp;&nbsp;  create a file open dialog
|-
|!&nbsp;&nbsp;&nbsp;  -------------------------
|-
|&nbsp;
|-
|file_dialog_new "Select output filename"
|-
|file_dialog_extension "Text files (*.txt)", "txt"
|-
|file_dialog_extension "All files (*.*)", "*"
|-
|file_dialog_show save, f$
|-
|&nbsp;
|-
|!&nbsp;&nbsp;&nbsp;  open the file on unit 1 for writing
|-
|!&nbsp;&nbsp;&nbsp;  -----------------------------------
|-
|&nbsp;
|-
|file1_open=0
|-
|&nbsp;
|-
|file_open 1, f$, write
|-
|if FileError<>0 then stop "Error opening output file"
|-
|&nbsp;
|-
|for i=1 to inum
|}
|}
inum=number_of_ops<br>
if inum<1 then stop "Please select an operation"<br>
<br>
!  create a file open dialog<br>
!  -------------------------<br>
<br>
file_dialog_new "Select output filename"<br>
file_dialog_extension "Text files (*.txt)", "txt"<br>
file_dialog_extension "All files (*.*)", "*"<br>
file_dialog_show save, f$<br>
<br>
!  open the file on unit 1 for writing<br>
!  -----------------------------------<br>
<br>
file1_open=0<br>
<br>
file_open 1, f$, write<br>
if FileError<>0 then stop "Error opening output file"<br>
<br>
for i=1 to inum<br>
:iop=next_op_number
:iop=next_op_number
:call "[[GetPathOneOp.mac]]", iop
:call "[[GetPathOneOp.mac]]", iop
next i<br>
{|
<br>
|-
file_close 1<br>
|next i
if FileError<>0 then stop "Error closing output file"<br>
|-
<br>
|&nbsp;
message "Finished, output file = %f$"<br>
|-
<br>
|file_close 1
run_exe "c:\Windows\System32\Notepad.exe", f$<br>
|-
<br>
|if FileError<>0 then stop "Error closing output file"
|-
|&nbsp;
|-
|message "Finished, output file = %f$"
|-
|&nbsp;
|-
|run_exe "c:\Windows\System32\Notepad.exe", f$
|}

Latest revision as of 15:17, 29 July 2010

check part_open, "You must have a part open to run this macro"
 
local i, inum, iop
 
 
get_op_list 1 !    get list of selected ops
inum=number_of_ops
if inum<1 then stop "Please select an operation"
 
!    create a file open dialog
!    -------------------------
 
file_dialog_new "Select output filename"
file_dialog_extension "Text files (*.txt)", "txt"
file_dialog_extension "All files (*.*)", "*"
file_dialog_show save, f$
 
!    open the file on unit 1 for writing
!    -----------------------------------
 
file1_open=0
 
file_open 1, f$, write
if FileError<>0 then stop "Error opening output file"
 
for i=1 to inum
iop=next_op_number
call "GetPathOneOp.mac", iop
next i
 
file_close 1
if FileError<>0 then stop "Error closing output file"
 
message "Finished, output file = %f$"
 
run_exe "c:\Windows\System32\Notepad.exe", f$