Christmas is coming and everyone wants to save their robot programs so they can go and have peaceful Christmas holiday. Well here’s an add-on that lets you save and load robot programs in XML format.
Known limitations:
Topology paths (Premium) are loaded without rebuiling properties (select curve, smoothing).
Thanks for the feedback. It was a bug that I didn’t catch in testing. Unit is indeed read only and you have to play with it using Quantity property and setUnitMagnitude method. So now the code is like this:
unit = app.findUnit(unit_string)
if unit:
prop.Quantity = unit.Group.Name
prop.setUnitMagnitude(unit.Factor)
I fixed it in the OP attachment. Note that property value is always in the so-called canonical form (e.g. millimeters) and magnitude determines how the value is shown in UI. I tested this fix only a little but for distance types it seems to work.