Jump to content

genbadger

Members
  • Posts

    7
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

genbadger's Achievements

Seeker

Seeker (1/7)

0

Reputation

  1. wow so quick! thank you very very much! I'm off to try it now! EDIT: Could you advise me how to use the script? I replaced ClipPut with Filewrite() and added the path to the file but when i run it, no errors occur but no file change occurs either..
  2. G90 G21 G0 X17.2644 Y1.6127 M03 G1 X2.2842 Y8.0674 G1 X15.3642 Y17.8133 G1 X17.2644 Y1.6127 G1 X2.2842 Y8.0674 M05 M03 G1 X3.14159 Y1.1111 G1 X15.3642 Y17.8133 G1 X17.2644 Y1.6127 G1 X3.14159 Y1.1111 M05 M03 G1 X4.5678 Y8.6753 G1 X15.3642 Y17.8133 G1 X17.2644 Y1.6127 G1 X4.5678 Y8.6753 M05 M03 G1 X7.7777 Y8.0674 G1 X15.3642 Y17.8133 G1 X17.2644 Y1.6127 G1 X7.7777 Y8.0674 M05 G0 X0.000 Y0.000 M05 M02 another example of a very small gcode file, notice how each m03 has a unique line following it and pasted above the next m05, not all the m05's, just the very next one
  3. Hi All, I'm not too code savvy but I know this is a simple one! Here's my problem, I have a folder with text files containing gcode. they are appended .nc, .ngc, and .gcode randomly. I can rename them all .ngc which is my preferred file type. In these files there's lines of gcode, carrying commands for a CNC. What I need to do is remove some comments from the beginning and format the text a certain way. I'll show an example of the original file and what I need it to look like. The files can be 20 lines or 10,000 long depending on the part. Old text: ( Header 1 text ) ( Header 2 text ) G90 (set absolute distance mode) G90.1 (set absolute distance mode for arc centers) G17 (set active plane to XY) G21 (set units to mm) #<z_safe> = 0.250 #<plunge_feed> = 5 (---------------------------------------------------------) G0 X 17.2644 Y 1.6127 M03 G1 X 2.2842 Y 8.0674 F 0.01 G1 X 15.3642 Y 17.8133 G1 X 17.2644 Y 1.6127 M05 G0 X 0.0000 Y 0.0000 M05 M02 What it needs to look like: G90 G21 G0 X17.2644 Y1.6127 M03 G1 X2.2842 Y8.0674 <--- copy and paste above the next m05 G1 X15.3642 Y17.8133 G1 X17.2644 Y1.6127 G1 X2.2842 Y8.0674 <--- pasted here M05 G0 X0.000 Y0.000 M05 M02 Some things to note: g90 sets absolute coordinate mode, g21 tets units to mm, g0 is first coordinate to move the tool to. This is an important step: m03 is what turns on a laser. I need the first coordinate after every m03 to be copied to the line above m05 for each chunk of gcode. the very last m05 before the m02 needs to be ignored. There are multiple chunks with m03 x,ys then m05. each chunk is going to have different coordinates after the m03. I have no idea where to start other than find the line with the wanted string, m03. dont know how to handle m05 though... any help is very much appreciated!
  4. Thank you so much man! It worked perfectly!
  5. Hey there! I have an issue that has been plaguing me. I am trying to retrieve the text typed into an input box, but it returns "Network name here". I need it to be what ever the user types into the box. Here is the code. I also have a file for the code. #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form2 = GUICreate("MyNetwork", 429, 212, 494, 236) $Button1 = GUICtrlCreateButton("Make a new Network", 8, 16, 145, 33, $WS_GROUP) $Button2 = GUICtrlCreateButton("Start", 8, 56, 145, 33, $WS_GROUP) $Button3 = GUICtrlCreateButton("Stop", 8, 96, 145, 33, $WS_GROUP) $Button4 = GUICtrlCreateButton("Refresh", 8, 136, 147, 33, $WS_GROUP) $Button5 = GUICtrlCreateButton("Status", 8, 176, 145, 33, $WS_GROUP) $Input1 = GUICtrlCreateInput("Network name here", 160, 24, 241, 21, $ES_NOHIDESEL) $Input2 = GUICtrlCreateInput("password", 160, 64, 241, 21) $Checkbox1 = GUICtrlCreateCheckbox("Hide characters", 160, 88, 113, 17) $Label1 = GUICtrlCreateLabel("Name of Network", 160, 8, 200, 17) $Label2 = GUICtrlCreateLabel("Password (min. of 8 characters)", 160, 48, 200, 17) $str1 = GUICtrlRead($Input1) $str2 = GUICtrlRead($Input2) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case $msg =$Button5 run("cmd") WinActivate ( "cmd" ) sleep ( 500 ) send("netsh wlan show hostednetwork") send( "{enter}") Case $msg =$Button1 run("notepad") WinActivate ( "notepad" ) sleep ( 500 ) send("netsh wlan set hostednetwork mode=allow ssid=" & $str1 ) Case $msg =$Button3 run("cmd") WinActivate ( "cmd" ) sleep ( 500 ) send("netsh wlan stop hostednetwork") send( "{enter}") Case $msg =$Button4 run("cmd") WinActivate ( "cmd" ) sleep ( 500 ) send("netsh wlan refresh hostednetwork") send( "{enter}") EndSelect WEnd GUIDelete() Exit GUI for network.au3
  6. ok... i think im kinda doing this right, but its naming the folder & _NowDate.... i want to get the naming right before i do the dircopy... please clear it up for me i have no clue wat to do... thanks for the advice u guys gave me already its put me on the right track. this is all i have and im really having trouble with it iv been workin on it for hours thanks #include <Date.au3> DirCreate("E:\ & _NowDate") dircopy("@mydocuments", "E:\
  7. Hey guys! Im new to autoit, so maybe someone can help. What im trying to do is everytime i plug my f: drive, prompt me to ask if i want to back up, then if i hit yes, make a new folder on the f: drive with that days date as the name, then copy my documents folder into it. Any help is very much appreciated, thanks for your time -genbadger
×
×
  • Create New...