Author Topic: 'Simulate with CAMotics' plugin  (Read 98400 times)

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
'Simulate with CAMotics' plugin
« on: September 13, 2016, 19:30:10 pm »
Hi !

Had some free time and rewrote my 'CAMotics export' python script as a plugin.
It will add a new entry to the Tools top menu. Single click on a 'Simulate with CAMotics' will regenerate G-code file,
create CAMotics xml project with embedded tools and stock definitions and (re)open it in CAMotics.

Source 1.5.1 on github:
https://github.com/jkmnt/cb2cm

Feedback is welcome )

By Eddycurrent ---
version 1.5.4 https://cambamcnc.com/forum/index.php?topic=6041.msg75177#msg75177

By JK ---
Version 1.5.1 - mop-specified tools are allowed now
Version 1.4 - fix for the diameter of conical tools
Version 1.3 - fix calculation of length for the conical tools, added warnings for tool diameter conflicts
Version 1.2 - fix for spaces in file path
Version 1.1 - changed nc paths in xml to relative
« Last Edit: April 29, 2022, 16:49:12 pm by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #1 on: September 13, 2016, 20:15:47 pm »
Sounds great, I'll give it a try tomorrow.
Filmed in Supermarionation

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #2 on: September 13, 2016, 20:36:51 pm »
Neat!  New plugin creation has been at a lull for a time.  Maybe your effort will stimulate it again.

(I'm one of the guilty)

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #3 on: September 13, 2016, 20:41:47 pm »

Just tried the plugin and it works very good. Thanks for that.

 As you say it creates Xml project file. Often wonder why would I want the xml project file.. As far as I'm concerned it is useless feature, because all I need to see/verify how machined part will looks like and CaMotics does this with out creating an xml file.. ;)
« Last Edit: September 14, 2016, 10:57:52 am by Bubba »
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5262
  • Made in England
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #4 on: September 14, 2016, 09:35:52 am »
Excellent job, works fine for me and have not come across any issues/bugs with it so far  :D
Filmed in Supermarionation

Online pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1967
    • View Profile
    • pixelmaker
Re: 'Simulate with CAMotics' plugin
« Reply #5 on: September 14, 2016, 16:18:56 pm »
Hello
I try this plugin. Because CAMotics is installed at a different drive (camotics nativ on mac, windows in a VM) I get the message:
"Failed to run CAMotics. Set location in cb2cm.config file or start CAMotics manually before CamBam to autodetect it."
If I start CAMotics before CamBam it don´t autodetect it, because the different drive. I don´t see cb2cm.config.
If I open the .xml file in CAMotics I don´t see any toolpath.
The path in the .xml file is <nc-files>Y:\Desktop\testcode1.nc</nc-files>. This path is wrong because the .nc file is at the same location then the .xml file.
If I change the path manually to  <nc-files>testcode1.nc</nc-files> I can open the file in CAMotics and all works.

I think the path must always be the only the filename, without storage path. NC file and XML file are always at the same place and it needs no absolute path.

ralf



Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #6 on: September 15, 2016, 11:14:57 am »
Thank you all for testing.

The xml project is for passing information absent in g-code to the CAMotics. Now it is a table of used tools, stock dimensions and sim resolution. Maybe a something else in the future as the CAMotics will develop.
If there are a tooltables synced between CB and CM, and correct stock size is of no interest, .nc will suffice )

Regarding the error:
I doubt one could launch native app (external to to vm) from the virtual machine.
cb2cm.config is stored in CamBam's system folder (Tools->Browse System Folder).
Upon CB startup, plugin tries to detect CM executable in location specified in config, else looks in some common locations (Program Files ...), else tries to find a running windows process named 'camotics' and determine the path it was started from. Detected location is stored in config for the next run.
e.g. my config entry is <camotics_path>D:\winp\app\camotics\camotics.exe</camotics_path>

Thanks for suggestion of pathless .nc files - it is a right way. Fix will follow )

Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3355
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #7 on: September 15, 2016, 11:28:36 am »
If there are a tooltables synced between CB and CM, and correct stock size is of no interest, .nc will suffice )
***************************************
That's exactly where I'm at...  ;)
My 2¢

Win11, CB(1.0)rc 1(64 bit) Mach3, ESS, G540, 4th Axis, Endurance Laser.

Offline jk

  • Wookie
  • ****
  • Posts: 265
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #8 on: September 16, 2016, 02:21:48 am »
Updated initial post with version 1.1

Online pixelmaker

  • CNC Jedi
  • *****
  • Posts: 1967
    • View Profile
    • pixelmaker
Re: 'Simulate with CAMotics' plugin
« Reply #9 on: September 16, 2016, 08:42:52 am »
Quote
in xml to relative
Thank you,
now it works also if the files are on different drives

ralf

Offline dwc

  • CNC Jedi
  • *****
  • Posts: 549
    • View Profile
    • corson.ch
Re: 'Simulate with CAMotics' plugin
« Reply #10 on: September 16, 2016, 09:29:38 am »
Thanks for your work making this plugin!
I have not been using CAMotics as I am too lazy to make those project files, now all is automatic, great!
Don

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 4484
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: 'Simulate with CAMotics' plugin
« Reply #11 on: September 16, 2016, 16:59:10 pm »
Just played with your plug-in.  THAT'S COOL. 

It created the XML and the G-Code just fine. 
Then it opened CAMotics. 
Then I had to open the project file manually. 

The results were good and dead easy compared to anything else I've done.  This is cool.

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 lloydsp

  • CNC Jedi
  • *****
  • Posts: 8969
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #12 on: September 16, 2016, 17:08:51 pm »
I'm not sayin' that Bob "has sway" with me, but when he says something is "cool", I listen.

First chance I get, I'll be trying this out, too!

Lloyd
"Pyro for Fun and Profit for More Than Fifty Years"

Offline joel.r1

  • Droid
  • **
  • Posts: 69
    • View Profile
Re: 'Simulate with CAMotics' plugin
« Reply #13 on: September 17, 2016, 13:34:09 pm »
Single click on a 'Simulate with CAMotics' will regenerate G-code file,
create CAMotics xml project with embedded tools and stock definitions and (re)open it in CAMotics.
All working fine, except it does not (re)open in CAMotics... CAMotics open, but is empty >:(
If I open the .xml file manually, then working fine.
CB files and .nc are not stored in default CB directory, but on USB stick. May be the reason.
Any idea ?
Cheers. Joel.

Offline Bob La Londe

  • CNC Jedi
  • *****
  • Posts: 4484
  • ^ 8.5 pounds on my own hand poured bait.
    • View Profile
    • CNC Molds N Stuff
Re: 'Simulate with CAMotics' plugin
« Reply #14 on: September 17, 2016, 15:52:07 pm »
I tried it and had the same result.  It did not open the XML file automatically.  I didn't really care.  The rest worked so well that little bit wasn't even annoying to me.  My NC files and CB files are each stored in a separate folder per customer and customer project, so I might have the same issue. 
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