- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anybody help?
Can somebody try the following to see if it is the script fault or the fault of Fusion 360?
Please create a simple rectangle sketch 100mm x 50mm and extrude it by 10mm
Obviously, if you run the following script, you should get 100mm x 50mm x 10mm
Here is my script:
import traceback
import adsk.fusion
import adsk.core
def run(context):
ui: adsk.core.UserInterface = adsk.core.UserInterface.cast(None)
try:
app: adsk.fusion.Application = adsk.core.Application.get()
ui = app.userInterface
des: adsk.fusion.Design = app.activeProduct
comp: adsk.fusion.Component = des.activeComponent
bBox: adsk.core.BoundingBox3D = comp.boundingBox
maxPnt: adsk.core.Point3D = bBox.maxPoint
minPnt: adsk.core.Point3D = bBox.minPoint
length = abs(maxPnt.x - minPnt.x)
width = abs(maxPnt.y - minPnt.y)
height = abs(maxPnt.z - minPnt.z)
unitsMgr: adsk.core.UnitsManager = des.unitsManager
defLenUnit = unitsMgr.defaultLengthUnits
ratio = unitsMgr.convert(1, unitsMgr.internalUnits, defLenUnit)
msg = [
f'length : {length * ratio} {defLenUnit}',
f'width : {width * ratio} {defLenUnit}',
f'height : {height * ratio} {defLenUnit}',
]
ui.messageBox('\n'.join(msg))
except:
if ui:
ui.messageBox('Failed:\n{}'.format(traceback.format_exc()))
I am getting a 0.02 increase on all dimensions.
Can I please ask if anybody else is getting the same error?
Many thanks in advance!
Darren
Solved! Go to Solution.