Thank you everyone for helping me, got a very quick and dirty plugin that works splendidly for my purposes now!
Figured i may as well post the code here for future references if anyone needs a extremely bare bones piece that will compile under Monodevelop / Linux. Main thing about it that was different for me was figuring out i had to add the Nuget package "Shim" in order to use the otherwise deprecated [Serialize] statement.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Windows.Forms;
using System.Xml.Serialization;
using CamBam;
using CamBam.UI;
using CamBam.Geom;
using CamBam.CAD;
using CamBam.CAM;
namespace CBSelectiveSoldering
{
public class SelectiveSolderingPlugin
{
protected static CamBamUI _ui;
// This is the main entry point into the plugin.
public static void InitPlugin(CamBamUI ui)
{
// Store a reference to the CamBamUI object passed to InitPlugin
_ui = ui;
// Create a new menu item in the top Plugins menu
//ToolStripSeparator toolStripSeparator = new ToolStripSeparator();
ToolStripItem ts = ui.Menus.mnuMachining.DropDownItems.Add("-");
ToolStripItem mi = ui.Menus.mnuMachining.DropDownItems.Add("Selective soldering");
mi.Click += new EventHandler(InsertMOP);
if (CADFile.ExtraTypes == null)
{
CADFile.ExtraTypes = new List<Type>();
}
CADFile.ExtraTypes.Add(typeof(MOPSelectiveSoldering));
}
static void InsertMOP(object sender, EventArgs e)
{
ICADView view = _ui.ActiveView;
if (view.CADFile.ActivePart is null)
{
CAMPart part = new CAMPart("Selective Soldering");
view.CADFile.Parts.Add(part);
view.CADFile.ActivePart = part;
}
MOPSelectiveSoldering SelectiveSoldering = new MOPSelectiveSoldering(view.CADFile, view.SelectedEntities);
view.CADFile.ActivePart.MachineOps.Add(SelectiveSoldering);
}
}
[Serializable]
public class MOPSelectiveSoldering : CamBam.CAM.MOPFromGeometry
{
protected double _SafeHeight;
protected double _RampInY;
protected double _Heatupdwell;
protected double _SolderFeed;
protected double _SolderMove;
protected double _RampInFeed;
protected double _PostFeedDwell;
protected object[] solderPoints;
protected ShapeList solderShapes;
//[CBKeyValue, Category("Selective Soldering"), DefaultValue(-5), DisplayName("Ramp in Y")]
[XmlAttribute("Ramp in Y")]
[DefaultValue(-5)]
public double RampInY
{
get { return _RampInY; }
set { _RampInY = value; }
}
[XmlAttribute("Ramp in feed")]
[DefaultValue(500)]
public double RampInFeed
{
get { return _RampInFeed; }
set { _RampInFeed = value; }
}
[XmlAttribute("Heatup dwell")]
[DefaultValue(0.5)]
public double HeatupDwell
{
get { return _Heatupdwell; }
set { _Heatupdwell = value; }
}
[XmlAttribute("Solder feed")]
[DefaultValue(150)]
public double SolderFeed
{
get { return _SolderFeed; }
set { _SolderFeed = value; }
}
[XmlAttribute("Solder feed")]
[DefaultValue(36)]
public double SolderMove
{
get { return _SolderMove; }
set { _SolderMove = value; }
}
[XmlAttribute("Post feed dwell")]
[DefaultValue(1.5)]
public double PostFeedDwell
{
get { return _PostFeedDwell; }
set { _PostFeedDwell = value; }
}
private void initValues()
{
this.Name = "Selective soldering";
_RampInY = -5;
_RampInFeed = 1750;
_Heatupdwell = 0.5;
_SolderFeed = 5000;
_SolderMove = 300;
_PostFeedDwell = 1.5;
}
public MOPSelectiveSoldering()
{
initValues();
}
public MOPSelectiveSoldering(CADFile file, object[] objects) : base(file, objects)
{
initValues();
}
[XmlIgnore]
public override string MOPTypeName
{
get { return "Selective Soldering"; }
}
protected override void _GenerateToolpathsWorker()
{
try
{
ClearToolpaths();
generateSolderPoints();
MachineOpStatus = MachineOpStatus.OK;
}
catch (Exception e)
{
ThisApplication.MsgBox("Exception");
}
finally
{
_GenerateToolpathsFinal();
}
}
private void generateSolderPoints()
{
string headerMod = new string('0', 0);
headerMod = "G90 G0 Z" + this.ClearancePlane.Value.ToString() + "\r\n";
for (int i = 0; i < this.PrimitiveIds.Length; i++) {
if (this.CADFile.FindPrimitive(this.PrimitiveIds[i]) is PointList)
{
Point3F[] points = ((PointList)this.CADFile.FindPrimitive(this.PrimitiveIds[i])).Points.ToArray();
for (int j=0; j< points.Length; j++)
{
headerMod = headerMod +
"G0 X" + points[j].X.ToString() + " Y" + (points[j].Y + (0 - this.RampInY)).ToString() + "\r\n" +
"F" + this.RampInFeed.ToString() + " G91 G1 Z" + (this.StockSurface.Value - this.ClearancePlane.Value) + " Y" + this.RampInY.ToString() + "\r\n" +
"G4 P" + this.HeatupDwell.ToString() + "\r\n" +
"F" + this.SolderFeed.ToString() + " G1 V" + this.SolderMove.ToString() + "\r\n" +
"G4 P" + this.PostFeedDwell.ToString() + "\r\n" +
"G90 G0 Z" + this.ClearancePlane.Value.ToString() + "\r\n"
;
}
}
}
this.CustomMOPHeader = new CamBam.Values.CBValue<string>(headerMod);
}
}
}