584,812 active members*
5,193 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > CamBam > CamBam number format
Results 1 to 10 of 10
  1. #1
    Join Date
    Nov 2012
    Posts
    1267

    CamBam number format

    I normally work in millimeters on a Mach3 CNC mill. So my program looks like this:

    Code:
    G0 X123.456 (rapid move to X=123.456mm)
    Problem is, now I need to generate a program for a Syntec machine that works in thousandths of a millimeter. So I need my program to look like this:

    Code:
    G0 X123456 (rapid move to 123456/1000 = 123.456mm)
    I can make CamBam output exactly 3 decimal places after the point by tweaking the post processor:

    Code:
    <NumberFormat>0.000</NumberFormat>
    But how do I get rid of the decimal point, short of doing "Search and replace" in a text editor?

  2. #2
    Join Date
    Jun 2015
    Posts
    4131

    Re: CamBam number format

    hope attached finds you well
    Attached Thumbnails Attached Thumbnails Untitled.png  
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  3. #3
    Join Date
    Nov 2012
    Posts
    1267

    Re: CamBam number format

    Quote Originally Posted by deadlykitten View Post
    hope attached finds you well
    Thanks Kitten, but Find/Replace is exactly what I was hoping to avoid.

  4. #4
    Join Date
    Jun 2015
    Posts
    4131

    Re: CamBam number format

    then how else you wanna fix it in a text editor ? aaaa, you mean to edit the post ... sorry, can't help with that

    but i can create a small program, to fix your file / background work service
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  5. #5
    Join Date
    Nov 2012
    Posts
    1267

    Re: CamBam number format

    Thanks for the offer Kitten, but that would be overkill. I only had 3 programs to make for the Syntec, so I did it in the text editor.

    Still would be nice to find a solution for the post processor though.

  6. #6
    Join Date
    Jun 2015
    Posts
    4131

    Re: CamBam number format

    i no longer deal with posts edit ... regardless of cam, as long as its generates a file, i can take it from there

    all this methods for post edit, different implementations, diff softwares ... is a mini madness, even if you know them all not to mention the duration of learn curves

    so, there is a common part in all of them, if you can see it
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  7. #7
    Join Date
    Nov 2012
    Posts
    1267

    Re: CamBam number format

    I wrote a Powershell script that converts all numbers for X, Y, Z, A, I, J (but leaves alone F).

    I wonder if there is a way to run the script automatically from the post processor? I think I might have seen something like that in the CamBam documentation...

    Code:
    rem Processes all .nc files in the current directory.
    rem Replaces X123.456 with X123456 for my Syntec controller
    
    for %%a in (*.nc) do (
    echo %%a
    powershell -Command "(gc %%a) -replace '([X|Y|Z|A|I|J]\-?\d{1,4})(\.)(\d\d\d)', '$1$3' | Out-File -encoding ASCII %%~na-Syntec%%~xa" )

  8. #8
    Join Date
    Jun 2015
    Posts
    4131

    Re: CamBam number format

    so it simply scans all *.nc files, and replaces all X***.*** with X***** ? who runs it ? you have to execute it manually ?
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

  9. #9
    Join Date
    Nov 2012
    Posts
    1267

    Re: CamBam number format

    Quote Originally Posted by deadlykitten View Post
    so it simply scans all *.nc files, and replaces all X***.*** with X***** ?
    Yes. The results are saved as new files ("-Syntec" is added to the original file name). The original files remain intact.


    who runs it ? you have to execute it manually ?
    For now I run it manually after posting a program. There might be a way to automate it in CamBam, I don't know for sure yet.

  10. #10
    Join Date
    Jun 2015
    Posts
    4131

    Re: CamBam number format

    hy citizen ( of dreams ) i automate by creating a service, or having exe hidden startup run, then loop repeat

    having them to fix post files, idea come when someone complained about having to fix the file each time after post
    Ladyhawke - My Delirium, https://www.youtube.com/watch?v=X_bFO1SNRZg

Similar Threads

  1. Replies: 0
    Last Post: 12-10-2014, 01:11 AM
  2. MS-DOS format to OSP format
    By bbarber80 in forum Okuma
    Replies: 6
    Last Post: 04-28-2014, 12:17 PM
  3. Replies: 14
    Last Post: 09-19-2013, 01:30 PM
  4. Bad Number Format error
    By bmurph in forum Mach Software (ArtSoft software)
    Replies: 5
    Last Post: 01-24-2012, 02:15 AM
  5. CamBam
    By ckjk616 in forum CamBam
    Replies: 4
    Last Post: 10-28-2010, 11:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •