Author Topic: CamBam to CAMotics export  (Read 10084 times)

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
CamBam to CAMotics export
« on: October 13, 2015, 13:07:13 pm »
Hello !

Here is a quick and dirty script to I wrote to export g-code from CamBam into CAMotics (open source cut simulator).
Basically, script is creating CAMotics project xml with a link to g-code + embedded tooltable of used tools + stock definition.

Anybody want to give it a try  ?
« Last Edit: October 13, 2015, 20:20:07 pm by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #1 on: October 13, 2015, 13:18:28 pm »
Hello

Welcome to the forum !

A script that will be usefull for some, I think ;D

++
David

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #2 on: October 13, 2015, 13:51:02 pm »
Hum !! I tried it but there is something that I don't understand in Camotics.(I attach a CB file + Gcode + xml)

The XML seems to contain the correct values for tools and stock, but when I open the Gcode in camotics, it seems that the xml file is not read ; no tools/stock appears in the tree at the left side  (and there is errors in the log windows) ...

What post pro we must use ... I tried Mach3-CV, LinuxCNc and Default ; same result  ???

PS: I don't know camotics, it my first use ..

++
David


Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #3 on: October 13, 2015, 14:23:16 pm »
More tests ....

- The xml file is read and tools and stock are set in camotics if I change the extension from  xxxx.nc.xml to xxxx.xml ... but ... in this case the Gcode is not read and I must open it separately.

- for this second problem, it's in the XML file ; the gcode name must be alone, without the filepath

ex:
camotics>
    <nc-files>
        C:\Program Files\CAMotics\examples\testcamotics.nc
    </nc-files>

with the previous code, the Gcode is not read

camotics>
    <nc-files>
        testcamotics.nc
    </nc-files>

and that works with this code ;)

small details to solve, but it's a nice job, congratulations

++
David

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: CamBam to CAMotics export
« Reply #4 on: October 13, 2015, 14:33:13 pm »
Thank you )

Looks like CAMotics is failing to parse whitespaces in filename (even for own-generated xml :)
As a quick fix, I am replacing all spaces with %20 and it's working now. Please see updated version.
« Last Edit: October 13, 2015, 20:20:32 pm by dh42 »

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #5 on: October 13, 2015, 14:56:34 pm »
Ok, that fix the Gcode loading problem.

The extension problem with the XML file remain (*.nc.xml)

++
David

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2984
    • View Profile
Re: CamBam to CAMotics export
« Reply #6 on: October 13, 2015, 17:46:35 pm »
Here you effort is much appreciated. It certainly be nice to have free decent simulator.
During 'test drive' of your script a following message appeared.. Figured it maybe of some help to you.. Win 10 OS and the latest CamBam..
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: CamBam to CAMotics export
« Reply #7 on: October 13, 2015, 18:08:34 pm »
Now I understand the extension problem. The supposed way to use CAMotics is to open xml project, not gcode file.
If one trying to open g-code, CAMotics tries to find matching .xml behind the scenes and opens it instead )

I've changed script to make .xml have a same basename as .nc file. There is a new version attached.

Bubba, looks like Python is not working at all at you installation. Try to execute a default blank python script (Script->New->Python Script. There should appear 'Hello' in console.

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #8 on: October 13, 2015, 18:10:48 pm »
Bubba, look here if that can solve your problem ;)


http://www.cambam.co.uk/forum/index.php?topic=5121.msg40528#msg40528

++
David

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #9 on: October 13, 2015, 18:16:31 pm »
Quote
I've changed script to make .xml have a same basename as .nc file. There is a new version attached.

Ok, work for me ;)

++
David

EDIT: I removed the old versions of the script in your messages ;)
« Last Edit: October 13, 2015, 20:23:05 pm by dh42 »

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 2984
    • View Profile
Re: CamBam to CAMotics export
« Reply #10 on: October 14, 2015, 00:02:33 am »
Bubba, look here if that can solve your problem ;)


http://www.cambam.co.uk/forum/index.php?topic=5121.msg40528#msg40528

++
David


Thanks David, That did the trick.
My 2¢

Win 10 64 bit, CB [1.0} rc 1 64 bit, Mach3, ESS, G540

Offline jcoffland

  • Ewok
  • *
  • Posts: 3
  • CAMotics creator
    • View Profile
Re: CamBam to CAMotics export
« Reply #11 on: October 15, 2015, 18:10:00 pm »
CAMotics creator here.  I cannot see the CamBam parsing part of the cb2cm.py script, i.e. the helpful part.  I don't have the CamBam Python libraries.  Reading CamBam tool tables is on my to do list.  Here's the GitHub issue: https://github.com/CauldronDevelopmentLLC/CAMotics/issues/71

I'm glad to see the CamBam crowd is interested in CAMotics.  Global tool tables and units settings are high on my priority list.

Please do consider sharing projects on our new site http://buildbotics.com/

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 3975
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: CamBam to CAMotics export
« Reply #12 on: October 15, 2015, 18:18:36 pm »
CAMotics creator here.  I cannot see the CamBam parsing part of the cb2cm.py script, i.e. the helpful part.  I don't have the CamBam Python libraries.  Reading CamBam tool tables is on my to do list.  Here's the GitHub issue: https://github.com/CauldronDevelopmentLLC/CAMotics/issues/71

I'm glad to see the CamBam crowd is interested in CAMotics.  Global tool tables and units settings are high on my priority list.

Please do consider sharing projects on our new site http://buildbotics.com/

You can download and install CamBam without buying it.  It is 40 executions limited in demo mode.  That can be days or months or possibly even years depending on how you use it.  After 40 uses its 1000 lines of code output limited.  1000 lines should be enough to test any compatibility issues.  Its primarily developed fr Windows, but there is a Linux version as well.  Also, if you want to persue active interoperability with CamBam you might be able to do some coordinating with Andy.  Even if he is too busy there are some really good script writers here among the users. 
Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 6133
    • View Profile
    • Cambam V1.0 French Doc
Re: CamBam to CAMotics export
« Reply #13 on: October 15, 2015, 18:32:28 pm »
Hello,

Welcome Joseph ;)

Hum, Bob, after 40 uses, not only the Gcode is limited to 1000 lines but the plugins and scripts no longer works....

++
David

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 4463
    • View Profile
Re: CamBam to CAMotics export
« Reply #14 on: October 15, 2015, 18:35:29 pm »
Joseph, these links might throw some light on scripts etc.

http://www.cambam.info/ref/script
http://www.cambam.info/ref/plugin
http://www.cambam.info/doc/api/CreatingAPlugin.htm

And there are source code files here for scripts and plugins;

http://www.cambam.co.uk/forum/index.php?board=6.0

Is there a plugin interface for CAMotics ?, I looked at the source code but it seemed there was not.
« Last Edit: October 15, 2015, 18:38:11 pm by EddyCurrent »
Made in England