Author Topic: A simple scripting example for CB1.0  (Read 9302 times)

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 267
    • View Profile
A simple scripting example for CB1.0
« on: March 13, 2019, 08:04:37 am »
I am attaching a simple scripting example for CB 1.0 - as a demonstration of the practical use of script objects.  The related CB file is also attached.

Geoff

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5248
  • Made in England
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #1 on: March 13, 2019, 09:34:17 am »
Geoff,

Nice idea, excellent little model on which to base the tutorial and an explanation with the utmost clarity.
Filmed in Supermarionation

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1807
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #2 on: March 13, 2019, 11:20:29 am »
Nice job Geoff, I'm subscribed to this guy https://www.youtube.com/watch?v=7Fn-26Jmi5E&t=584s  where he describes, what you can do with these things.
Dave

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 267
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #3 on: March 13, 2019, 23:57:16 pm »
Dear Dave

Many thanks for the reference, I had not understood the origins of this toy as the Trammel of Archimedes  (https://en.wikipedia.org/wiki/Trammel_of_Archimedes).  But, with this background the project of building a working model is even more interesting, perhaps one with more sliders next time.

Geoff

Offline dave benson

  • CNC Jedi
  • *****
  • Posts: 1807
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #4 on: March 14, 2019, 22:47:53 pm »
Hi Geoff

A few years ago now, I was looking for the math to make a Watts Link
to drive a Hydraulic piston (A Watts Link is an Aproximate Straight Line Generator)
Anyway I ended up at the Reuleaux Collection at Cornell.
Here http://wayback.archive-it.org/2566/20180418124639/http://kmoddl.library.cornell.edu/model.php?m=272
Trammel

http://wayback.archive-it.org/2566/20180418124914/http://kmoddl.library.cornell.edu/model.php?m=244
Peaucellier Mechanism.

If I had have been more confident in my skills to make it, I would have made the Peaucellier Straight-line Mechanism
which is a mathematically perfect Straight line generator.

Some of the Mechanisms there are mesmerising to see operate.

Dave

Offline garym1957

  • Ewok
  • *
  • Posts: 39
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #5 on: December 14, 2020, 18:38:26 pm »
Complete noob here.  Frrustrated at this.

How do I RUN YOUR SCRIPT, GeoffreyGRoy?

IDK why information like this is hidden.  Does everyone already know this and thats why no one shows a step by step for noobs?

Running a script looks like hitting F5 to compile?
Where does the script have to live>What directory>does_it_live_in? How do I call the script?

Assuming everything is in the right place,  WHAT THEN??

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5248
  • Made in England
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #6 on: December 14, 2020, 19:11:58 pm »
Script files normally live here; C:\ProgramData\CamBam plus 1.0\scripts
Using CamBam menu option, Script->Open , select the required script then click "Open".
Once the script has opened in the popup window press F5 to run it.

BUT ! in this case Geoff has used a CamBam entity called a "Script Entity"

Referring to the attached image.

Download the cb Geoff attached called, "Simulation.cb"
Open that file in CamBam.

Expand the layer called "Layer Script"
Select the Script Entity by left clicking it once
Press F5 to run it.
Watch the animation.

« Last Edit: December 14, 2020, 19:23:10 pm by EddyCurrent »
Filmed in Supermarionation

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 267
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #7 on: December 16, 2020, 04:12:00 am »
Dear garym1957

Eddy has provided the information you need to run the script.  If you have any further questions please do not hesitate to ask.

 As a self described "noob" you will find that this Forum will provide most of the answers you will need in your CNC journey.  While I will admit not all the contributions are always fully documented (but they are free!) I would encourage you to continue to ask questions and I am sure you will find the info you need from one or more of the Forum members.

Geoff

Offline garym1957

  • Ewok
  • *
  • Posts: 39
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #8 on: December 24, 2020, 00:52:08 am »
I appreciate the encouragement.

This is for a job and I'm worried I can't deliver.
I was excited to find a working example which is the CamBam-plasma.xml and family, dfound on this website.  This does what I need, (torch on, torch off, cut holes from tangent, etc).  But it's in Metric, which I prefer over Footric.  But the customer is American and they only work in inches and feet.
Does anyone know where to modify the plasma.XML, plasma.cb, and plasma.cbpp files

I'm expecting to find a SINGLE instruction within one of those to convert it to inches but I'm finding nothing of the sort.

I'm just wanting to automate the cutting of holes.  A monkey should be able to do this.   You guys kind enough to reply, realize this is like Chinese arithmetic to me. 

Does anyone know how to convert these files from MM to inches?  https://cambamcnc.com/ref/article/CamBam-Plasma.zip

If not, how can I automate some specific hole cutting sequence? Do I need Subroutines, a script, XML ???


Offline Bubba

  • CNC Jedi
  • *****
  • Posts: 3353
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #9 on: December 24, 2020, 15:03:51 pm »
To convert to inch, Right click on polyline you working with , transform, resize.
My 2ยข

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

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8938
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #10 on: December 24, 2020, 15:17:31 pm »
....'polyline'...
-------
OR all drawing objects!  Also, don't forget to change your drawing's units to inch/English from metric.

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

Offline GeoffreyGRoy

  • Wookie
  • ****
  • Posts: 267
    • View Profile
Re: A simple scripting example for CB1.0
« Reply #11 on: December 24, 2020, 23:32:08 pm »
Dear garym1957

Well, the experts have arrived, it should now work for you.  - Merry Christmas to all.
Geoff