Fusion 360 Hackathon – Q&A #1 #2

So far we had two online presentations and two 1 hour Q&A sessions where developers could come and ask about anything related to Fusion 360 API.

Here is a concise version of the discussions from the first 2 Q&A sessions Brian and I had. 

Keep in mind that Fusion has a new release every months or so, and therefore if you’re reading this article at a later time, some of the missing functionalities might be available. 

Q: In case I develop in C++ on Windows, can you publish the application for the Mac platform too? 

A: We cannot for two reasons:  
1) we would need your source code to compile it on our side and that could cause legal issues 
2) we would probably break Apple/Xcode EULA by compiling projects for someone else using our developer account    

Q: Can I do the same geometry queries on sketch features as on BREP elements, e.g. asking for area and inner points? 

A: The sketch related object that could have area properties is the Profile object since it defines a closed planar area.  Currently this object only supports topology information and doesn’t expose any area functionality. 

Q: Can I check whether a point is an inner point of a geometry (so somewhat the inverse of getting an inner point)? 

A: For BRepFace it is possible to find out if a point lies on the face.  This is done using the isParameterOnFace method of the SurfaceEvalutator that you can get from a face.   

Q: Is there any object equivalent to the RegionProperties object in the Inventor API? 

A: No there is not.  

Q: Is there some sort of UI guideline when creating apps? 

A: It is work-in-progress. Brian will also add a section to the help file on where to place your command buttons on the toolbar depending on the functionality they provide.   

Q: Is there a simple way of sorting the browser tree? 

A: No, and there is no direct access to the browser tree at all. 

Q: Which tool could be recommended to display calculated scalar and vector fields in the Fusion 360 API (like client graphics in the Inventor API)? 

A: There is nothing for that at the moment as there is no client graphics API in Fusion yet.   

Q: Can I add buttons to places other than the toolbar – e.g. to the browser?  

A: No. 

Q: Is a custom command automatically linked to the “edit feature” in the history bar (timeline), so it relaunches with the last settings when a user wants to do changes (like e.g. with press/pull command) 

A: The timeline only shows features, which means that what you would need is a client feature, but that is not available at the moment.  

Q: Is there any way to display set of triangles, e.g. for a mesh? 

A: The only way is sketch lines at the moment, but depending on the amount of those, it could be costly. 

Q: Can I do Boolean operations on the solid bodies? 

A: You would need to use the combine feature for that. You could not do it just in-memory using transient objects. 

Q: Is it possible to access non fusion files (e.g. xml or json) from the data panel project or do they have to be stored locally (e.g. with the installation).  

A: You can only open design files and only in the UI – i.e. you cannot open them in the background just to read some information from them. Locally stored files can be read in the background as well – see “Parameter I/O” from https://apps.autodesk.com/FUSION/en/Detail/Index?id=appstore.exchange.autodesk.com%3aparameterio_macos%3aen   

Q: Can I include extra files with the installation package of the app? 

A: Yes you can. We have sample apps on the Autodesk Exchange store which do that too, e.g. “Parameter I/O” sample.  

Q: Can you get the data from a different project than the one the user is currently using. (something like setting up a library with components and metadata that I than want to share with others) 

A: The API currently only provides access to your own projects but this should be available in the future so you have access to all of the same data as you see in the Data Panel.   

Q: Could you explain the purpose of text commands bar in the workspace? Can we use it to add points, sketches?  

A: These are for internal testing.  Currently it’s not possible to access API created commands through the text commands. 

Q: Are there any plans for more advanced support of external render engines? I mean event system, ability to draw in render workspace, more organized material API, etc 

A: We want to continue to expose through the API the functionality you see in the user-interface.  There are some areas related to rendering where the API is incomplete.  Beyond that, there has not been any discussion of additional API only functionality to expose. 

Q: How to turn on ‘do not capture design history’? 

A: The Python code below sets the preference to create a Direct Modeling design, creates a new design, and then sets it back to the original value. 

def createDirectModelDocument():
ui = None
try:
app = adsk.core.Application.get()
ui  = app.userInterface
# Get the Fusion specific Design preferences.
desPrefs = app.preferences.productPreferences.itemByName('Design')
# Save the current value of the setting.
initialValue = desPrefs.defaultDesignType
# Set the value to create a direct edit design.
desPrefs.defaultDesignType = 
adsk.fusion.DefaultDesignTypeOptions.DirectDesignTypeOption
# Create a new document.
app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)
# Set the preference back to the initial value.
desPrefs.defaultDesignType = initialValue
ui.messageBox('Success')
except:
if ui:
ui.messageBox('Failed:n{}'.format(traceback.format_exc()))

Q: What happens if you turn on 3D sketches (FusionProductPreferences is3DSketchingAllowed)? 

A: The preference to allow 3D sketches is controlling the UI and doesn’t have any impact on the API.  Sketches in Fusion are always 3D and if these setting this preference to not allow 3D forces the user to always draw in the X-Y plane of the active sketch. 

Note: Brian will have a presentation today as well. Today’s topic is “Introduction to the Fusion object model

-Adam


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading