- GCode and Part Programs
- CAD CAM
- PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
- new2linux
- Offline
- Platinum Member
-
Less
More
- Posts: 711
- Thank you received: 9
14 Jun 2017 18:30 - 14 Jun 2017 18:58 #94509
by new2linux
Replied by new2linux on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Many, many thanks Todd!!
Yes, that is the FILTER section of the .ini file. I need to save just the "Bash script" as a .sh file in the conf folder. The "Bash script" is just the very top part, or the whole part (like between the ## at the top and ## at the bottom)? I will look to see if there is any M111 custom m-code shown.
many thanks!
Edit: M111 is in the CAM software (my case Bobcad) and search thru to see. The samples that are shown (Todd's earlier example) one of the part that goes in the .ini file, and a 2nd part that requires the "ngc = ~/linuxcnc/configs/my_mill/z-pause.sh" plus some additional info is also in the 2nd part. Many thanks!
Yes, that is the FILTER section of the .ini file. I need to save just the "Bash script" as a .sh file in the conf folder. The "Bash script" is just the very top part, or the whole part (like between the ## at the top and ## at the bottom)? I will look to see if there is any M111 custom m-code shown.
many thanks!
Edit: M111 is in the CAM software (my case Bobcad) and search thru to see. The samples that are shown (Todd's earlier example) one of the part that goes in the .ini file, and a 2nd part that requires the "ngc = ~/linuxcnc/configs/my_mill/z-pause.sh" plus some additional info is also in the 2nd part. Many thanks!
Last edit: 14 Jun 2017 18:58 by new2linux. Reason: clearify
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4987
- Thank you received: 1455
14 Jun 2017 19:26 #94511
by Todd Zuercher
Replied by Todd Zuercher on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
The bash script "is" the file. And if all you want it to do is find and replace the Z lines, it only needs to be
If you also want it to add some lines at the beginning and end of your file, you can add some "echo" lines.
#!/bin/bash
sed 's|\(.*\)Z\([-,0-9,\.]*\)|M0 \1(Z\2)|g' "$1"
If you also want it to add some lines at the beginning and end of your file, you can add some "echo" lines.
The following user(s) said Thank You: new2linux
Please Log in or Create an account to join the conversation.
- new2linux
- Offline
- Platinum Member
-
Less
More
- Posts: 711
- Thank you received: 9
15 Jun 2017 13:22 - 15 Jun 2017 13:35 #94535
by new2linux
Replied by new2linux on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Many thanks, Todd!
I have the following screenshot of my current progress.
The permissions were granted by rt click on "z-pause.sh".
The .ini file is below, but will cut and paste "FILTER" section here:
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
ngc = ~/linuxcnc/configs/LinuxCNC/z-pause.sh
Many thanks
Edit: add z-pause (cut&paste):
#!/bin/bash
sed 's|\(.*\)Z\([-,0-9,\.]*\)|M0 \1(Z\2)|g' "$1"
I have the following screenshot of my current progress.
The permissions were granted by rt click on "z-pause.sh".
The .ini file is below, but will cut and paste "FILTER" section here:
[FILTER]
PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
PROGRAM_EXTENSION = .py Python Script
png = image-to-gcode
gif = image-to-gcode
jpg = image-to-gcode
py = python
ngc = ~/linuxcnc/configs/LinuxCNC/z-pause.sh
Many thanks
Edit: add z-pause (cut&paste):
#!/bin/bash
sed 's|\(.*\)Z\([-,0-9,\.]*\)|M0 \1(Z\2)|g' "$1"
Last edit: 15 Jun 2017 13:35 by new2linux. Reason: file error
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4987
- Thank you received: 1455
15 Jun 2017 14:42 #94540
by Todd Zuercher
Replied by Todd Zuercher on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
That is odd, the same script file works for me. Aside from some messing up the find and replace in some comments and other such things.
Not sure where your errors are coming from. But the problem is not in your ini file or the path to the script. it is being found and ran. The problem is in the script file it's self.
What did you use to create/edit the script file?
You can't use a word processor, you have to use just a plain text editor.
Not sure where your errors are coming from. But the problem is not in your ini file or the path to the script. it is being found and ran. The problem is in the script file it's self.
What did you use to create/edit the script file?
You can't use a word processor, you have to use just a plain text editor.
The following user(s) said Thank You: new2linux
Please Log in or Create an account to join the conversation.
- new2linux
- Offline
- Platinum Member
-
Less
More
- Posts: 711
- Thank you received: 9
15 Jun 2017 15:03 #94541
by new2linux
Replied by new2linux on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Todd, I must confess I copied (from your example) and pasted to create new file, that I renamed to the .sh extenstion. I will review and start from scratch if necessary. The script file is the one that needs attention, I will work on it.
many thanks!!
many thanks!!
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4987
- Thank you received: 1455
15 Jun 2017 15:24 #94543
by Todd Zuercher
Replied by Todd Zuercher on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Copy the file I attached above, and rename it.
The following user(s) said Thank You: new2linux
Please Log in or Create an account to join the conversation.
- new2linux
- Offline
- Platinum Member
-
Less
More
- Posts: 711
- Thank you received: 9
15 Jun 2017 16:08 - 15 Jun 2017 16:10 #94546
by new2linux
Replied by new2linux on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Todd, Many Thanks!!
I used your advise, to start with the file you attached, rename it, to sh, used "notepad" for new file. The screenshot is attached:
I have reviewed the .ini file, looks correct; reviewed the sid after copied to conf folder. looks ok. Not shore where to review/look.
Many Thanks!
Edit: after coping, I set permissions again.
I used your advise, to start with the file you attached, rename it, to sh, used "notepad" for new file. The screenshot is attached:
I have reviewed the .ini file, looks correct; reviewed the sid after copied to conf folder. looks ok. Not shore where to review/look.
Many Thanks!
Edit: after coping, I set permissions again.
Last edit: 15 Jun 2017 16:10 by new2linux. Reason: clearify
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Offline
- Platinum Member
-
Less
More
- Posts: 4987
- Thank you received: 1455
15 Jun 2017 17:29 #94548
by Todd Zuercher
Replied by Todd Zuercher on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
The following user(s) said Thank You: new2linux
Please Log in or Create an account to join the conversation.
- new2linux
- Offline
- Platinum Member
-
Less
More
- Posts: 711
- Thank you received: 9
15 Jun 2017 17:40 - 15 Jun 2017 17:54 #94549
by new2linux
Replied by new2linux on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
I did not show 62 bytes shell script, am looking in to now, and shows 1KB.
Edit: after looking to see it appears the attachment has maybe an issue, but it is probable just me. I am still working this, is it the same to cut & paste in a note pad type of software, vs. copy your original file with file management type of software and save that as the .sh file?
Edit: after looking to see it appears the attachment has maybe an issue, but it is probable just me. I am still working this, is it the same to cut & paste in a note pad type of software, vs. copy your original file with file management type of software and save that as the .sh file?
Last edit: 15 Jun 2017 17:54 by new2linux. Reason: clearify
Please Log in or Create an account to join the conversation.
- new2linux
- Offline
- Platinum Member
-
Less
More
- Posts: 711
- Thank you received: 9
15 Jun 2017 18:26 #94550
by new2linux
Replied by new2linux on topic PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Please Log in or Create an account to join the conversation.
- GCode and Part Programs
- CAD CAM
- PostProcessor or ISO a script to insert M0 for "Z" (Linuxcnc & BobCad v23)
Time to create page: 0.143 seconds