Afternoon Klaus,
With regard to the FreeCAD version starting to be a factor would this be a step too far, changing the beginning of InitGui.py - def Initialize(self) from
to
Code: Select all
def Initialize(self):
import FreeCAD
from PySide import QtGui
FC_MINOR_VER_REQUIRED = 17
FC_COMMIT_REQUIRED = 13500
FC_MINOR_VER_RECOMMENDED = 18
FC_COMMIT_RECOMMENDED = 14575
ver = FreeCAD.Version()
gitver = ver[2].split()[0]
if gitver != 'Unknown':
gitver = int(gitver)
else:
gitver = FC_COMMIT_REQUIRED
if int(ver[0]) == 0 and (int(ver[1]) < FC_MINOR_VER_REQUIRED or (int(ver[1]) == FC_MINOR_VER_REQUIRED and gitver < FC_COMMIT_REQUIRED)):
fc_msg = "FreeCAD version ({}.{}.{}) must be at least {}.{}.{} to be used with the A2P workbench".format(int(ver[0]), int(ver[1]), gitver, 0, FC_MINOR_VER_REQUIRED, FC_COMMIT_REQUIRED)
print(fc_msg)
diag = QtGui.QMessageBox(QtGui.QMessageBox.Critical,u"Error Message",fc_msg )
diag.exec_()
elif int(ver[0]) == 0 and (int(ver[1]) < FC_MINOR_VER_RECOMMENDED or (int(ver[1]) == FC_MINOR_VER_RECOMMENDED and gitver < FC_COMMIT_RECOMMENDED)):
fc_msg = "While FreeCAD version ({}.{}.{}) will work with the A2P workbench, it is recommended to use {}.{}.{} or above".format(int(ver[0]), int(ver[1]), gitver, 0, FC_MINOR_VER_RECOMMENDED, FC_COMMIT_RECOMMENDED)
print(fc_msg)
diag = QtGui.QMessageBox(QtGui.QMessageBox.Warning,u"Advisory",fc_msg )
diag.exec_()
else:
fc_msg = "This version {}.{}.{} of FreeCAD meets the recommended version {}.{}.{} to work with the A2P workbench".format(int(ver[0]), int(ver[1]), gitver, 0, FC_MINOR_VER_RECOMMENDED, FC_COMMIT_RECOMMENDED)
print(fc_msg)
import sys
Note: I just came up with arbitrary version numbers for me to carry out some testing so you would need to amend these to suit and I'm sure you could code it much cleaner, I was just looking at something to help.