Author Topic: C++ examples?  (Read 2764 times)

Offline llaves

  • Ewok
  • *
  • Posts: 49
    • View Profile
C++ examples?
« on: December 30, 2020, 23:15:31 pm »
Are there any examples of C++ plug-ins I can refer to?
Maybe this has been asked before, but wouldn't it be useful for folks to include source of their plug-ins so others could cobble from them? Of course, it would be strictly voluntary.

Offline lloydsp

  • CNC Jedi
  • *****
  • Posts: 8892
    • View Profile
Re: C++ examples?
« Reply #1 on: December 30, 2020, 23:49:12 pm »
Llaves,

Most folks who write plugins for CB do supply their source code!

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

Offline dh42

  • Administrator
  • CNC Jedi
  • *****
  • Posts: 7295
    • View Profile
    • Cambam V1.0 French Doc
Re: C++ examples?
« Reply #2 on: December 31, 2020, 01:07:45 am »
Hello

As said Lloyd the source code is given for a lot of plugin, but it's not C++, it's C# (or Visual basic .net) read the topics off the different plugins, you certainly will found what you want ;)

example here
https://cambamcnc.com/forum/index.php?topic=4855.0/index.php

https://cambamcnc.com/forum/index.php?topic=6228.0/index.php

some are also on Gitub
https://github.com/pstemari/v-engrave-plugin

and in the plugin folder you also have an example given by Andy (the programmer) for the HeightMapPlugin as zip file.

++
David
« Last Edit: December 31, 2020, 01:15:54 am by dh42 »

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5211
  • Made in England
    • View Profile
Re: C++ examples?
« Reply #3 on: December 31, 2020, 10:07:33 am »
I posted a simple example of a plugin using C# here; https://cambamcnc.com/forum/index.php?topic=6668.msg53974#msg53974

I use Visual Studio Community 2017
Filmed in Supermarionation

Offline llaves

  • Ewok
  • *
  • Posts: 49
    • View Profile
Re: C++ examples?
« Reply #4 on: December 31, 2020, 15:44:55 pm »
thanks to everyone who responded. A couple of specifics:
1. As to C++ - I am aware that most plug-ins are written in C#. The CamBam website says C++ is possible, which I guess is true in general of any .Net libraries, but I was hoping for examples as I'm a lot more familiar with C++ than C#. I guess I'll just have to muddle through with C#.
2. Thanks for the pointers to plug-ins that include source. I looked at a few and didn't hit on ones with source. Maybe just bad luck? The repository at Atelier-des-Fougeres gives no indication which, if any, include source. I checked a few and drew a blank.

I'll just have to dig deeper in this forum history.

Thx again

Offline EddyCurrent

  • CNC Jedi
  • *****
  • Posts: 5211
  • Made in England
    • View Profile
Re: C++ examples?
« Reply #5 on: December 31, 2020, 16:04:57 pm »
So did you have a go at compiling the example project I linked to ?
Once you get that working in CamBam you know the method, all that remains is to get an idea and write more code.

Everyone who writes plugins has the same problem, you just have to search around and find what you can.

The Object Browser in Visual Studio is VERY useful if you point it to CamBam.CAD.dll  ;)
« Last Edit: December 31, 2020, 16:09:28 pm by EddyCurrent »
Filmed in Supermarionation

Offline llaves

  • Ewok
  • *
  • Posts: 49
    • View Profile
Re: C++ examples?
« Reply #6 on: December 31, 2020, 17:51:36 pm »
Haven't had a chance to try that yet. I'm fighting some installation problems moving CamBam to a new computer
(and I'm fighting an even more bizarre Mach3 problem that's stopping me from running a program I'd like to finish up).