Export point coordinates?

Export point coordinates?

joergen_nilsson
Advocate Advocate
227 Views
4 Replies
Message 1 of 5

Export point coordinates?

joergen_nilsson
Advocate
Advocate

Is it somehow possible to export the point (or corner) coordinates from a sketch?

The purpose is to using the coordinates in a separate program for calculating 2D trusses.

 

 

0 Likes
228 Views
4 Replies
Replies (4)
Message 2 of 5

jhackney1972
Consultant
Consultant

There is no real point export routine in Fusion but they do have "Copy to Clipboard" on the Measure command.  If you are using Windows operating system, you can activate the Extended Clipboard and then it is an easy job to record and then paste coordinates to another application.  The video will show this.

 

John Hackney, Retired
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 3 of 5

joergen_nilsson
Advocate
Advocate

Thanks, but I run on Mac. However, I found a script on modthemachine.typepad.com but can't get it to work properly.

 
 
##################################
import traceback, adsk.core, adsk.fusion
import io


def run(context😞
ui = None
try:
app = adsk.core.Application.get()
ui = app.userInterface
# Get all components in the active design.
product = app.activeProduct
design = adsk.fusion.Design.cast(product)
title = 'Export Spline csv'
if not design:
ui.messageBox('No active Fusion design', title)
return

# if app.userInterface.activeSelections.count != 1:
# ui.messageBox('Select profile before running command', title)
# return

# profile = app.userInterface.activeSelections.item(0).entity
# if not type(profile) is adsk.fusion.Profile:
# ui.messageBox('Selected object needs to be a profile', title)
# return

dlg = ui.createFileDialog()
dlg.title = 'Save CSV File'
dlg.filter = 'Comma Separated Values (*.csv)'
if dlg.showSave() != adsk.core.DialogResults.DialogOK :
return
 
filename = dlg.filename
with io.open(filename, 'w', encoding='utf-8-sig') as f:
profile = adsk.fusion.Profile.cast(profile)
loop = profile.profileLoops.item(0)
curves = loop.profileCurves
for curve in curves:
curve = adsk.fusion.ProfileCurve.cast(curve)
entity = curve.sketchEntity
point = entity.startSketchPoint
point = adsk.fusion.SketchPoint.cast(point)
geometry = point.geometry
f.write(str(geometry.x) + "," + str(geometry.y) + "\\n")

except:
if ui:
ui.messageBox('Failed:\\n\{\}'.format(traceback.format_exc()))

########################################################

0 Likes
Message 4 of 5

johnsonshiue
Community Manager
Community Manager

Hi! I am not sure if the "Publish to PLY" app on Fusion App store would help.

 

https://apps.autodesk.com/FUSION/en/Detail/Index?id=8481236243625457783&appLang=en&os=Win64

 

Please take a look.

Many thanks!



Johnson Shiue (johnson.shiue@autodesk.com)
Software Test Engineer
0 Likes
Message 5 of 5

joergen_nilsson
Advocate
Advocate

Looks promising but only on Windows.

0 Likes