I've tried also just to do an affine transformation like this
mytransf = adsk.core.Matrix3D.create()
mytransf.setToIdentity()
global thisdocsunits
if thisdocsunits == "mm":
myscaleratio = 1/1000
elif thisdocsunits == "cm":
myscaleratio = 1/100
mytransf.setCell(1,1,myscaleratio)
mytransf.setCell(2,2,myscaleratio)
mytransf.setCell(3,3,myscaleratio)
- you see, I just want to export this STL with the right values in it without having to change the document's properties. I believe your exportmanager for the STL is faulty and is not doing the size conversion it should be doing(? well, this is a matter of taste, but SolidWorks does it). The STEP export is working fine, or so it seems.
Backtrace give me the output:
DEBUG:root:could not save stl. Traceback (most recent call last):
File "C:/Users/Frederico/AppData/Roaming/Autodesk/Autodesk Fusion 360/API/AddIns/newbadasscommand!/newbadasscommand!.py", line 286, in genlink
rootComp.occurrences.item(i).transform = thistransf
File "C:/Users/Frederico/AppData/Local/Autodesk/webdeploy/production/96bbf24ce680e1f0f939cd63033d4708c60a6e96/Api/Python/packages\adsk\fusion.py", line 18832, in <lambda>
__setattr__ = lambda self, name, value: _swig_setattr(self, Occurrence, name, value)
File "C:/Users/Frederico/AppData/Local/Autodesk/webdeploy/production/96bbf24ce680e1f0f939cd63033d4708c60a6e96/Api/Python/packages\adsk\fusion.py", line 51, in _swig_setattr
return _swig_setattr_nondynamic(self,class_type,name,value,0)
File "C:/Users/Frederico/AppData/Local/Autodesk/webdeploy/production/96bbf24ce680e1f0f939cd63033d4708c60a6e96/Api/Python/packages\adsk\fusion.py", line 44, in _swig_setattr_nondynamic
if method: return method(self,value)
File "C:/Users/Frederico/AppData/Local/Autodesk/webdeploy/production/96bbf24ce680e1f0f939cd63033d4708c60a6e96/Api/Python/packages\adsk\fusion.py", line 18947, in _set_transform
return _fusion.Occurrence__set_transform(self, *args)
RuntimeError: 2 : InternalValidationError : pMatrix->isValidNonScaledTransformMatrix()
Thank you very much for you help in advance!
Frederico.