Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Importing Image as Canvas Using API?

Anonymous

Importing Image as Canvas Using API?

Anonymous
Not applicable

Hello all. Is there any way to import a .jpg or .png image to a plane using the API? Trying to insert a reference image to go alongside our 3D model. So far we have found out how to insert an .svg onto a construction plane, however the image quality is extremely poor after the conversion (from .jpg to .svg) thus it no longer has landmarks that serve our purpose. If there is any way to get a .jpg with a canvas onto a plane using the API that would be exactly what we are looking for! 

 

Thank you for your help!

0 Likes
Reply
860 Views
6 Replies
  • API
Replies (6)

BrianEkins
Mentor
Mentor

Unfortunately, that capability is not supported by the API. Hopefully, at some point in the future, but I don't know.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
1 Like

Anonymous
Not applicable

Ah, too bad to hear. Thank you for the response! My team and I hope to see this feature implemented sometime in the future.

0 Likes

mitgandhi
Observer
Observer

import adsk.core, adsk.fusion, traceback

def run(context😞

try:

app = adsk.core.Application.get()

ui = app.userInterface

# Get the active design.

product = app.activeProduct

design = adsk.fusion.Design.cast(product)

root = design.rootComponent

# Get the path to the image file.

file_path = r"C:\path\to\image.png"

# Import the image into Fusion 360.

import_manager = design.importManager

import_options = import_manager.createImportOptions(file_path)

imported = import_manager.importToRootComponent(import_options)

ui.messageBox("Image imported successfully!", "Success")

except:

ui.messageBox("Failed to import image:\n{}".format(traceback.format_exc()), "Error")

0 Likes

mitgandhi
Observer
Observer

The emoji has me posted by mistake.

0 Likes

mitgandhi
Observer
Observer

import adsk.core, adsk.fusion, traceback

def run(context)

try:

app = adsk.core.Application.get()

ui = app.userInterface

# Get the active design.

product = app.activeProduct

design = adsk.fusion.Design.cast(product)

root = design.rootComponent

# Get the path to the image file.

file_path = r"C:\path\to\image.png"

# Import the image into Fusion 360.

import_manager = design.importManager

import_options = import_manager.createImportOptions(file_path)

imported = import_manager.importToRootComponent(import_options)

ui.messageBox("Image imported successfully!""Success")

except:

ui.messageBox("Failed to import image:\n{}".format(traceback.format_exc()), "Error")

0 Likes

BrianEkins
Mentor
Mentor

What is this sample supposed to be? It doesn't work and is calling a function that doesn't exist.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes