- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
Edit: darn i posted this to the wrong forum....
Im not sure if this is another issue to do with step export/import in fusion or the python api.
version: 2.0.13619
I have noticed that there is a 1-3 decimal place difference for area and volume between exporting a fusion360 file to a step and bringing it back in again to fusion.
to recreate the problem, new document.
In a new sketch i created a sphere, and then extruded it to make a cylinder.
In the gui, if i select the body and check its volume and area it shows me a nicely rounded up number.
In fusion via the api if i look at my current in fusion cylinder i get something like this:
object:Body1 area:172.29879618644645 volume:163.36281798666926
I then export out the file to a step file.
when i open the step file up again in fusion and run the same lookup i get this:
object:Body1 area:172.2987961864465 volume:163.36281798666934
The bit of code im running is fairly simple:
app = adsk.core.Application.get()
ui = app.userInterface
# get active design
product = app.activeProduct
design = adsk.fusion.Design.cast(product)
exportMgr = design.exportManager
# get root component in this design
rootComp = design.rootComponent
# get all occurrences within the root component
rootOcc = rootComp.occurrences
bodies = []
def get_bodies(occurrences):
"""
get all the bod
"""
for occurrence in occurrences:
if occurrence.isLightBulbOn == False:
# app.log(f" occurrence: {occurrence.name} is hidden, ignoring. \n")
continue
parent = occurrence
for body in occurrence.component.bRepBodies:
if body.isLightBulbOn == False:
# app.log(f" body: {body.name} is hidden, ignoring. \n")
continue
# do something here
bodies.append(body)
if occurrence.childOccurrences:
get_bodies(occurrence.childOccurrences)
def get_phys_props():
"""
show me the physical props im intereted in the textport
"""
get_bodies(rootOcc)
for body_obj in bodies_list:
physicalProperties = body_obj.getPhysicalProperties(
adsk.fusion.CalculationAccuracy.VeryHighCalculationAccuracy)
area = physicalProperties.area
volume = physicalProperties.volume
log(f'object:{body_obj.name} area:{area} volume:{volume}')
I have attached the f3d that has my cylinder and the step file it creates.
Let me know if there is any thing else you need to trouble shoot this issue.
thanks
Kym
Solved! Go to Solution.