I don't think any settings file is used if none is specified. But it should initialize to something regardless.I'm not specifying any files in the interpreter, so I'm assuming it's using default.set, as it does have units set to default to MM.
I think you could just specify a different Vars file. Make a copy of emc.var with offsets of zero.Now I've learnt this, how do I get around the problem of external offsets being used?
Do I need to initialise things in a different order, or just send some kind of command to the interpreter prior to loading my settings?
Here is some code from SimpleGCodeWPF example to force an update:Also, during all this, I've noticed that any changes to offsets using SetOrigin, don't take effect until the related offset is requested again. Do I need to explicitly call the offset again, or is there some method I'm missing?
Code: Select all
private void Set_Fixture_Offset(int Fixture_Number, double X, double Y, double Z)
{
// Set GVars for Offsets
KM.CoordMotion.Interpreter.SetOrigin(Fixture_Number,
KM.CoordMotion.Interpreter.InchesToUserUnits(X),
KM.CoordMotion.Interpreter.InchesToUserUnits(Y),
KM.CoordMotion.Interpreter.InchesToUserUnits(Z), 0, 0, 0);
KM.CoordMotion.Interpreter.SetupParams.OriginIndex = -1; // force update from GCode Vars
KM.CoordMotion.Interpreter.ChangeFixtureNumber(Fixture_Number); // Load offsets for fixture
}