export a camotics tooltable

This commit is contained in:
sliptonic
2022-07-11 14:27:42 -05:00
parent 842fd4772b
commit 792cb05473
3 changed files with 96 additions and 8 deletions

View File

@@ -286,6 +286,9 @@ class ToolBit(object):
break
if doc is None:
p = findToolShape(p, path if path else obj.File)
if p is None:
raise FileNotFoundError
if not path and p != obj.BitShape:
obj.BitShape = p
PathLog.debug("ToolBit {} using shape file: {}".format(obj.Label, p))
@@ -482,6 +485,9 @@ class ToolBitFactory(object):
def CreateFrom(self, path, name="ToolBit"):
PathLog.track(name, path)
if not os.path.isfile(path):
raise FileNotFoundError(f"{path} not found")
try:
data = Declaration(path)
bit = Factory.CreateFromAttrs(data, name, path)