Forge and Fusion 360 Hackathon - Intro to Fusion 360 API

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
I want to welcome everybody to this introduction to the fusion 360 API I'm Brian Deakins and the API designer for the API and it will just give a another minute here and see some more people come in and we'll get started introducing fusion 360 the API and hi I'm Brian Eakins and let's go ahead here so yes I'd ask questions you there's a raise hand icon or it probably better as you can type a question into the questions panel and we'll we'll watch for those as we go along so all right so maybe just first what is fusion 360 and so it's been included into this forge hackathon you know kind of separate for jacket on and fusion 360 so what what is it what does it have to do with forge and so here's my definition of what fusion 360 is a little bit long but so a design simulation and manufacturing cloud centric desktop application and let me go through what I mean by that so design so it's it it's a modeling system so I can use fusion and these are all parts models that I got there's a gallery where customers can can allow others to see what what they've designed and these are some of the models that the fusion customers have created them and posted onto the gallery and so fusion can be used to design you know typical kind of industrial parts like you that upper-left model is a steam engine so those kind of things but also more freeform abstract kind of models that you see in some of the other ones so and so a broad range of of modeling is supported there's also simulation so you can use Fusion to build into Fusion is also a simulation tool so you can validate them a model to see if it's going to build a work under the conditions you plan to use it and and there's also manufacturing so I've created a model and now I need to actually produce it and so Fusion supports what you see here is the creation of numerical control tool pass to be able to cut a model what I don't have a picture of but also 3d printing so I can create a model and 3d print it so that's the design simulation and manufacturing part of the definition so all that's built in diffusion and also said is it a web or cloud centric desktop application and so first the desktop application part of that definition so when you go to the fusion 360 website and you can install Fusion from there so it's installed onto your local hard drive and it runs locally on your computer ok there's it's not it's not a browser that's talking to the to the web to be able to to do the modeling but it's it's running locally and this to a standard desktop interface like most other applications that you use on on your computer and because of that it also will work when you're offline because I have all of the code locally and so fusion can work when I'm on an airplane or I'm somewhere where I don't internet access I can still continue to work offline and when I'm working whether I'm connected to the network or not the speed of my modeling calculating tool fast doing analysis is independent of my network speed because it is a local application and it's provided for both the Windows and Mac so there's versions for both the operating systems so that's the desktop application part of it and then the web-centric cloud centric so this first one is kind of simple so that you can't get a CD or a DVD of fusion so it's solved from the web and it's also automatically updated from the cloud so when you start fusion fusion checks if it if there is a network it checks to see if there's an update and if there is an update it automatically pulls that down and updates your version in fusion so you're always up to date updates come out a couple of times a month typically and so that happens automatically through the cloud and this is the big one and this is what kind of tie is fusion in to forge is that all of your data is saved on the cloud using a 360 so so basically fusion uses a 360 as its file system so when I create a new design and I click Save it doesn't ask me where on the disk I want to save that it asked me which project on a 360 in which folder and then when I save it that gets copied up onto a 360 and when I browse to open an existing design I'm looking at what's on a 360 and and opening it from there and so that that's what they say what ties this into forge is that now I can use for JP ice or any of the fusion data because it's already on in the in the cloud on a 360 and I have access to it through the for JP ice and also another thing the fusion does is you can use the cloud for some additional simulation capabilities and for for rendering so it's it's optional you can do some local but if you want in some cases some more powerful or to just offload the mission you can can use the cloud for that all right so Fusion has all those capabilities as an end user to let me model and simulate and manufacture my model but there's it also supports an API because you know as a user a lot of times maybe I have this tedious process that you do over and over and I want to automate that and so I take out the error and I just don't like to do the same thing over and over and over and speed it up or as a third party developer I have a solution to something that I think Fusion users could use and so I want to deliver that solution to them and so that this API makes that possible and so the API basically like fusion it's a local API so it's running within that local copy when I start up fusion it's running locally on my machine and the API is running inside that local instance desktop instance of fusion so a fusion isn't running on a cloud somewhere and I'm not talking to that I'm always running within fusion on my local machine there's a single API so when I designed the API actually design it in a an IDL or interface definition language and then we have a tool that reads that API definition and creates the the stubs function a the fusion core and then a developer goes in and actually adds the code to make those work but so that that's all done in C++ so that so it's these C++ functions are created and implemented and then also that process that we that definition language that created those C++ stubs it also created a Python and JavaScript wrapper over those C++ functions so it is really a single API with these these three bindings to these different languages and I'll talk later about maybe why you choose one language over the other and the API supports creating both kind of simple scripts if I I'm a user and there's just this process I do over and over and say I just write a little simple script to help automate that and more complex apps I have this really sophisticated application that I want to deliver and and it so it supports all of that so it just to get started on kind of what the API supports a big part of that for both simple and it's more complicated applications is is you need to be able to just drive fusion fusion so you want to to do the same kind of things that the end-user would do but automate that and here's a an example so I want to to create a gear and I can look up on the web and find out the formula for how an involute tooth is is created and get out my calculator or maybe write a little function in Excel that would calculate points along that involute and so I get the points I fit a curve through those I mirror the that curve over so now I have the sides of one tooth and I created an arc along the top I extrude it so now I have one tooth on my gear I can pattern that that tooth around and now I have a gear okay so as an end user I could build the gear but it wasn't very fun and now I need a gear of another size you know so I go through that whole process over again so with an API I can build a nice interface where it asks just for the gear parameters click OK and then it does basically what I just described but it automates it right so as an end-user it's simple here's another example where they wanted to simulate gouges in this in this wood and so it's basically little partial Tauruses that have been subtracted out of the the revolution big-body that started with that was created by a revolution and so these little partial Tauruses are positioned all over the model and I could do that interactively but it would just be so tedious that they wouldn't want to get very far but with an API I can automate that process alright so here's where we are today as far as what the API supports with respect to what Fusion can do and so Fusion is broken up into multiple workspaces it's called so if it's upper left you see model so this is the modeling workspace this is where you do 3d solid modeling and so what this is showing is all of the commands that Fusion has for 3d modeling solid modeling and the things that are in green the API has full support for so I can create edit and query the things that are shown in green those commands the things in yellow it has some partial support for and the things in white it there's currently no support for and the things in white so if there's a real need for it we we will add support for those but most of those they aren't particularly that they aren't either used very much or they're not there's other ways to do it besides that command that may be better from an API perspective so here's when another workspace is the patch workspace this is for working with surface models rather than solid models and so we have pretty good coverage there a lot of the commands are the same between the two and where we don't have any coverage you can see the lines just drawn through so the these other workspaces rendering animation simulation and drawing currently there's zero API functionality for those four workspaces but for cam there is some limited cam functionality currently exposed so through the API portion for cam I can interrogate all of the current setups and tool paths that have been created and find out if they're up to date or if they failed for some reason so I can I can query those and I can post process I can output setup sheets and I can generate tool pass so if a tool path is out of date I can cause it to recalculate an update itself and so there's some workflows that this is nice for so if I've created a model and I have a tool path on it and now I'm I automate modifying that model then I can also automate updating the tool pass and creating a new and post-processing on with those new tool paths so I could automate that but things I can't automate is creating new tool pass and so that should be coming at some point in the future but it's not here now the API also has support for for the data panel so the data panel is kind of fusions interface to a 360 so I don't have to go to it a 360 itself but Fusion has this this panel to the side that lets me browse my workspaces folders in those workspaces and see in existing models that I have and then I and can open them from here and do some some other things right so the API provides equivalent functionality for this so it's really similar to the data management part of forge right but I don't need to mess around with OAuth because when I'm using the API I'm a I'm basically that user that's logged into Fusion I'm acting as them and so I just use the API to interrogate and there's there's no no authorization needed I'm already that user there's also some translator support so this is kind of like model derivative but again no auth I'm not having to connect to any service but it's awesome do it's just whatever that Fusion supports locally for translation and fusion has this export command and also this new design from file command to let me read in models and export to write out and then I'm limited to you know fairly small number of formats so to do more than that and I can use a model derivative API but as I said before since fusion is is saving the files to a 360 the fusion file is already there so I can access it through the model derivative you know use the model derivative API to export it in a lot of other formats okay so there's also functionality and the API that's specific to the API so there's not you know it's not an equivalent to a command but something that that's only in the API and so one of those is to build it to get detailed information from a model and so for example I have this simple model here and I could get this face and from the face I can get its edges and find out that it has well first I can find out from the face I can find out that it's planar I can get normals from it curvatures different information from from the face itself they can get its edges I can find out you know this top edge that it's it's a linear edge and that that edge connects to this top face and I can see that that face has two loops hasn't this outer rectangular loop and this inner loop for this pocket and so this inner loop is made up of quite a few edges I can get their shape interrogate them for for tangents and curvatures and then find out which faces connect to those edges so I can I can really get you know the complete information from the model geometrically and topologically so it's a boundary representation model of the solid surface and sometimes I don't need that I'm doing an application where just a triangular mesh representation the model is good enough and so the API also exports getting the model representation just as a mesh and you can control the tolerance of that mesh and and other factors that define how that mesh is generated the API provides access to the assembly structure so I can get components and find out what components are inside it so basically I can see that a component is representing a sub assembly and then does it contain any their assemblies or parts and if it has a sub assembly I can find out what's inside it and I can traverse this an entire assembly structure through the API I can create custom commands so fusion has this really nice well-defined concept of what a command is and I'll demonstrate some of that a little bit later but part of that is these common dialogues that all the fusion commands use and so you can create these custom dialogues to get different kinds of inputs from user selections or values all different kinds of data the API or supports creating we have kind of two two ideas of some color script and something called an add-in and code wise there there's really almost no difference it's more and just have what what it looks like to the user so a script he runs from and I'll show you this dialogue in a little bit but he he runs a command inside fusion that brings up the scripts and add-ins dialog and so he can see a list of all the scripts he would choose his script from there and say run and it would run do whatever it needs to do and then it's done and if he needs to run it again he would go through that same process again bring up the dialog pick it run it at again his fusion finds that as of starting up and will run it as as it starts up and then typically what an add-in does is in that startup phase is it will add its custom commands into the fusion UI and then and then it just sits in the background still running but sits in the background listening for if any of its commands get executed and then if they do then it would pop up a dialog like you see and interact with the user and do its thing and then it's done and so if I create an add-in that has these custom commands then to a user those commands just look like building fusion commands because whenever he starts fusion I just have this new functionality and the API also supports something called attributes so this lets me tag whatever information I want onto fusion geometry so I can add information that you know that I use to give more intelligence to this model or in other common uses just to tag something so I can find it later kind of a way of naming something so some some future functionality some things that were working on is custom graphics so I can draw my own things inside with all the fusion data so these I think we're our more advanced so that'd be more for the bigger applications would use this kind of stuff rather than the end user just writing a script but it's all a part of that single API and everybody can use whatever they need for whatever they're trying to do custom workspaces and also a custom browser I talked before where Fusion has these workspaces so we saw the modeling workspace in the patch workspace and rendering so it's a way to group functionality into so when the user is doing that particular task all they see is the commands for that that are needed for that task and that's a workspace and so able to create custom workspaces and the browser you would be able to define what's inside that browser and custom features and today fusion supports some events but it's not very much right now so we want to support additional events t-splines so that some of those those free form models a lot of those were done with some functionality inside fusion that's called T splines and a way to model and that currently that's not supported through the API at all and so we want to support that I talked to a minute ago about how Fusion has its well defined idea of what a command is and all the fusion commands use the same dialogues so it's you can define the content of the dialogue but how it looks and behaves is the same for all fusion commands but sometimes you need more than what that can do and so we'd like to be able to support HTML based dialogue so you could create whatever you want and so those are some of the things you know that we're we're working on now or in the near future and then we'd really like to hear you know what you need and we can add that to our list so we've got a big list of things we want to do and it's just prioritizing it and your input is is very valuable to help us do that so a little more detail about about the API how it works so there's this API object model so the API is an object-oriented API where there are these different objects or classes and this chart each one of the little boxes which you can't see because it's too small but each one of these little boxes represents a different object and most of the objects in there have a an obvious one-to-one correspondence with things you would be familiar with in Fusion so for example there's a an object called an extrude feature and which obviously corresponds to an extrude I would create in fusion and there's a sketch line and a sketch dimension so right now there's 559 objects defined in the API with over 6,000 methods and properties on those different functions 82 e-news so there's quite a bit defined in that and the hierarchy and we'll look at this in more detail and on the next slide where we can actually see it but so this this chart so I've got the top-level object and then from that object I can get to other objects and from those objects I can get to other objects so there's this hierarchy of objects and this hierarchy doesn't define class structure it's not like drive classes and like you wouldn't see a lot of times in maybe is a C++ specific API but that it indicates ownership and most cases this is fairly logical so if I think of I have a sketch line what would on a sketch line well it'd be the sketch and what we don't a sketch that would be a component and what would on a component that would be a design and what would on a design that would be a document and so that that list that I just described that that's how this chart is laid out if we could look and see I would see that from a document I can get a design and from a design I can get all of the sketches and then from a sketch I can get all of the lines within a sketch and so that's this hierarchy again is defining kind of that ownership and so to get to something I have to kind of understand that ownership so I can go from one object to the other to get to the object that that's important to me all right so now we're going to look get a little more detail at this section right here for for sketching along with some code and so here's a blow-up of that section so we can actually see some of these objects and so the kind of the most important object is this top-level application object and the and why it's so important is because if I get access to that then I have access to everything else right so that's the gateway to the API really and so all of these objects they support methods and properties and a few of them support events and so from the application I can get to these objects and then I can call their methods and properties and events to to either query information to change them to create new things and there's two different kind of types of objects shown here in the chart so you notice some of them have rounded corners and some are just rectangular boxes and the rounded corner objects are referred to as collection objects and they're a little bit special so they don't correspond to anything in the user interface there their API only objects and what they do is they provide access to existing objects and it's also through those that I create new objects so for example you can see kind of in the middle of the chart there there's a sketch circles object and so that's so every collection there's no exception to this every collection has a property called item and the property called count and so count so if I got to the sketch circles collection for a particular sketch and I got its count property that would tell me how many sketch circles are in that sketch and then I could use the item property to get those circles so so if there are two circles like two items of zero would me the first circle and items have one who give me the second circle and then the sketch circles collection also supports some methods to let me create new circles so there's several methods because there's different ways to create a circle so I think add by center radius or add by three points and so that would create a new circle within that collection basically creating a new circle on the sketch that that that I got that collection from and then there's also it's not shown on this chart but there's also another object that we call an input object and I'll show an example in a minute of this but it it provides kind of the equivalent it's the API equivalent to a command dialogue so a command dialogue is used to gather input from the user and cell phones so for example if I want to create an extrude I as a user when I run the extrude command it brings up the dialogue and it guides me through the input that's needed to create an extrusion and then once I've provided the necessary input I can click OK and then excuse me and then the extrusion is created and so these input objects in the API are basically the same thing it's just a object that has properties that I need to define and then once I define those properties that's the input that's needed to create the extrusion then I can say okay now go create it because you have all the information you need all right so let's look at some real code here an example so we're still going to use that that sketch geometry and for that sketch portion of the API and so here's some this is Python code and this first line there's a library called a dsk autodesk the API is broken up into two two libraries within it called the core and fusion and ideally we wouldn't have done this looking back but at the time we we didn't we thought that maybe this core which is just kind of generic general functionality might be used by other applications besides just fusion but it looks like that's not going to happen so but core functionality and then fusion functionality and so what I'm doing is specifying this a dsk namespace in the core library and within the core library is the application object is defined and on that application object I'm calling this static function called get and that's getting me the application object and so now I'm tied in to this object I have it so I'm tied in to this object model and it returns the application object the application object has a property called active product so I call that and it returns the design so a product the way fusion documents work is they contain a lot of data and so within the single fusion document I can have the design so my model I can have tool paths I can have animation information and those are all the term that the API gives it as those are different products within that single document so when I get the design product that's the the modeling data that's contained in this document and so I'm getting the active products I'm assuming that they have that they're in one of the workspaces that is for modeling if I wasn't this would would fail later on because I wouldn't give back a design object so but anyway so from that I'm I'm calling give me the active product and so that's returning this design object the design object has this root component property and so the root component is this top-level guy in in the browser right here called widget v1 so that that's that's the that owns everything inside this design and so I'm calling the root component property to get hit so now I have in this object chart I'm down to this component object so you can see I'm just traversing down through this i from the root component then I get its collection of sketches so now we're at this object and then I also get the X Y construction plane from the route component and just save that into a variable and then on the sketches object I call its add method and pass in that plane and so now it just created a new sketch on that plane and I would see that show up in the browser at that point so now we're down to this we have a sketch object and then on the sketch object I go call the sketch curves property so we're this object and then I call on it the sketch circles property which returns to sketch circles object and I save that in this variable called circles so now I have this object the sketch circles object and then it has a method called add by center radius I pass in so here's another object called a point 3d object and it has a a create static function on it so I call create which creates this point 3d object which is just a wrapper over an XYZ coordinate so I'm specifying an XYZ coordinate and a radius and then that creates a new circle and I give back that sketch circle that actually exists in the model now and now I want to add a dimension to that to control its size so I use the sketch from the sketch I get the sketch dimensions collection and I call this add diameter dimension method on it I pass in the circle that we just created and then I create another XYZ point which defines the position of the dimension text so now it just created a dimension so that's kind of that the basic idea of how the API works with this object model the structure and then how the objects support different methods and properties to let me get things and and create new things so this is Python and here's the exact same program in JavaScript so you can see I'm doing exactly the same thing because it's it's the same API just exposed with a wrapper for a different language and so if I go back to Python you can see the code is is really exactly the same just there's some syntax differences right I have to use the VAR statement wherever I'm creating a new variable and then how comments are defined is different so that's and I've got semicolons and here's the C++ equivalent of the same language over the same program and so again pretty similar so there are some syntax differences between the same language they said it's always the same API but sometimes because of the just how the different languages work there's a little bit of difference so for example C++ doesn't support properties and so but there is a gift and a set that provide the equivalent functionality of a standard property and so there's a little bit of a different flavor of the language or of the API depending on which language you're using but it but it's the same API alright so here's a look just building on that sample we just looked at to see how that those input objects that I referred to earlier work so building on what we just did we just created a circle in a sketch and add a dimension to it and now from that sketch when I in the user interface when I draw a sketch and then when I run a command so here the extrude command as I move the mouse over the model different portions of that sketch will highlight and those are referred to as profiles so they're closed areas within the sketch the fusion is computed and so what I've done doing here in this sample is so my program created a new sketch and it created a single circle in that sketch so I know that's all that's in the sketch and so this is on the sketch there's a collection of profiles so those are automatically computed by fusion so it's all of the closed areas and I'm just getting the first one which I know is that one single circle that I just created so now I have that profile and then from the root component I'm getting the collection of getting the features object so I'm calling a features property on the root component which returns the features object and then from the features object I'm calling the extrude features property which returns this extrude features object and I'm saving that in this variable and then on the extrude features object there's a create input and I'm passing in the profile because that's always needed for all extrude the profile and what kind of operation so this in the dialog is showing new body here I'm specifying new component which is another option so now I've kind of initialized I've created this new input with some basic sum of an initialized and now I need to tell it what's the extent how far do I want this extrusion to go and there's different ways to define that I can say I just go five five inches in this direction or go five inches in both directions or just go up to this surface and so in this case I'm just want to go a certain distance this first argument is saying if I want to go symmetric or not and the second argument is saying how far I want to go so I'm creating an object to pass in that information of how far I want to go and so now we've defined the the extent we want this extrusion to go and so now we've defined everything we need to fully define an extrusion and so now we can call the add method on the extrude the extrude features collection and pass in the input that we had just defined and now that creates the real extrusion so the best way to think about these inputs like I said is just the kind of the API equivalent of the dialog it's it's gathering all the information that's needed to create a more complex object so the inputs are just used for complex objects like we just saw when I create a sketch circle I just directly create it I don't have to create an input is in an intermediate step but for complex things where there's especially a lot of different options and just a lot of input these input objects are used it's a little bit on choosing language and so Python I think is is the best choice for if you're an end-user wanting to dis customized fusion you know at do some some simple scripting or even some add-ins with some commands but it's probably something I'm gonna use for myself or or I'm happy to share it with other people too but it's it's going to be the fastest language I think to learn and to use and and it's it's once you get used to its quirks it becomes pretty nice to use so as I said you can use it for simple things but also more complex commands so kind of a downside with Python is if you do share it with other people if you delivery your program you're really delivering your your so source code so you know that that's one big reason that like professional applications would tend to probably not want to use Python C++ so it's going to be the fastest language out of all three of them and it's also going to be the hardest one to use just because C++ tends to be it's the harder languages to learn and to use and so an advantage with C++ as I'm delivering just my binary so on on Windows and delivering a DLL on Mac and delivering a dy live and so one thing I don't have listed here is with Python where I am delivering the source code and it's interpreted at runtime I can create one program that will run on Windows and Mac and I can probably just develop it on one or the other and it's just going to work on the other one and don't really even have to test it but with C++ because I'm delivering a binary I have to if I want to support both I have to comply on a Windows machine or on Windows OS that to compile at for Windows and then on a Mac machine I have to compile it for Mac so that's a little bit of a pain to support both systems but it's a JavaScript so it's this the way the API has been implemented currently JavaScript runs out of process so if it's running outside of fusion and then talking to fusion on Windows and on Mac it actually runs inside fusion but anyway because of how its implemented currently it's quite a bit slower to use on Windows and because of this out of process thing two events have some problems and so we just chosen not to expose events or most most of the events through JavaScript so there are some limitations there and JavaScript just has some built-in limitations because JavaScript was really designed to work with webpages it's the language to drive you know HTML and CSS and to control a webpage and here we're using it as just a generic general programming language but it has built into it security limitations because of its web background so so there are aren't functions to access your hard drive and to read a file and do things like that and so for some basic stuff like that we've actually added that into the API the fusion API for JavaScript we added some additional functions to let you read and write files and do things that you would want to do but but there's other things that just aren't there in JavaScript that you can do in C++ and Python so so as you can tell I JavaScript what wouldn't be my first choice so I would look at Python and C++ so to get some information about the API there's right let me just demonstrate this rather than talk about it and so if we go in into fusion and first thing is the help so if I go to help and programming interface it will take you here and there's this section in the help this programming interface section with all the other fusion help and there's this page that it initially takes you to is welcome to the fusion 360 API and so this has some links to some other resources there's a github site that has quite a few samples and also some some videos so about a year we did a just a fusion specific hackathon and did a whole series of videos with that and so you have access to those videos through this github site and then there's also quite a few samples here that object model chart so there's a PDF of that that chart that you can access from here to that you can print out and then there's a discussion group and so this is the best place if you have questions so so myself and the rest of the development team with group and answer questions that come in there so you can use discussion group and then I also have a blog or a post information about fusion and and the inventor API so this mod the Machine blog so to talk about a little more what's in in the help here so they're just welcome gives you access to some other resources there's the what's new tab that describes what's new in the in the latest update and so there's some overview topics at the top here and then a detailed list of every new object and and the new methods and properties that have been added in this latest update and then there's this user's manual and it has quite a few overview topics so just how do you create a new script or add in some basic concepts which a lot of those had just gone over what is an object model objects collections that kind of thing so just go into that one so we've got concepts how to customize the user interface how to create commands separate topic for command inputs those are the things that go into the dialogue to let you get input from the user how events work how to use those how documents are structure inside fusion working with solids and surfaces working with attributes remember that's the thing where you can add information to the fusion objects how units work inside fusion so all these different topics so and then some specific topics for if you're using C++ JavaScript or Python and anyway so this is probably the best place to start or those videos that are on YouTube or down on YouTube and then here this reference manual so this is really the guts of the API documentation so here's a list of all those can't remember several hundred objects and so for example this appearance object and then it has several methods and properties but so if I go to the appearance object here's the detailed documentation for it what methods and properties is supports and how and which properties return an appearance object how do I get an appearance object but if we go look here so here's a property it shows me kind of an example of how might be used this isn't really a sample but but it is illustrative of how you would use it for these different languages JavaScript and Python and then quite a few of the the objects do have so let's go to one that I know has some so let's look at extrude feature so it's method and properties and then it has a topic down here with some samples where an extrude feature is demonstrated so if I go to that and here's here is it some sample code that I could copy and paste into run and I have a JavaScript Python and C++ and then finally here in the in the help there is it's just another way to access those sample programs but so they're organized by themselves and so if I am just interested in working with assemblies and occurrences so here's a sample that demonstrates that and so let's say it's one sample that's accessed from from several different points right and so just to finish off go ahead and show off a few sample programs that demonstrate some of the API and I've got so I'll just go through a few of these and say feel free to any questions to go ahead and type those into the the questions panel one I'll just keep going with samples for a little while and watch for questions as they might come up so back to fusion and let's start off with the I guess a simpler one is let me if you haven't seen Fusion before I'm and it created a simple model here so I said I want to draw a new line so it knows I oh that's for a sketch so it's going to ask me to to create a new sketch and to create a sketch I need to pick some planar object inside the model and so that my model is empty right now except it does have an XYZ base planes and so I want to create a new sketch on on this plane and it's reoriented it so i can see that i want to work in inches and we'll just make a real simple shape here so so there's a basic shape and I can control its size now by adding dimensions to that so let's say I want that to be 5 inches you can see the model adjusted as I changed the dimension there's this one I want this to be in a relationship to this one so right now it's 3.2 inches but I want it to be relative to this and this one all of these have behind the dimension is something called a parameter and the parameter behind this one is is named d1 so when I click this it put d1 into this field like say I want this to be d1 times 0.6 got 2 dots so this will always be 60% of this one and put a dimension here and I want this one to always be maybe half of that one and that's good enough so I'll and stop the sketch now I want to extrude that and extrude it some height whatever and then we want to add maybe some other features to that so I'll had to fill it pick these edges and a little more and let's hollow it out so I'll create a shell feature so I picked the face that I want to remove and then how thick I want that and then maybe one more fill it just around the bottom okay so now we have this part and as I was modeling a whole bunch of parameters were created so so fusion supports a couple of different ways really three different ways to model is I can do parametric feature based modeling which is what I've been doing here I can do direct modeling which is more like where it doesn't have any intelligence it's just I'm just pushing and pulling on faces and the model changes in a smart way but it doesn't have parameters driving those changes and I can also use the T spline which is more like working in and clay really I can sculpt and pull and drag but here there's some advantages to using this parametric modeling because now I have all these parameters that have been created and here's d1 I'm going to rename it to change and I'll show you why in a second and you can see these other parameters that are dependent on it automatically updated so now but now if I if I change that value so it's five inches now I want to change it to six the model recomputes and I have a little Python program here and so it gets application object like we saw before it gets the active product and gets a which is the design and the design object has an all parameters property and so that's all of the parameters in the design no matter where they exist and I want to get the one that's called change its and Kanye's item by name property so now I have that parameter and then down here I'm just I'm going through a loop where I'm changed starting at a certain value and going to a value and incrementing by some value and each time I go through this loop I change the value of the parameter and this probably isn't gonna work particularly well on line because of the latency but let me go ahead and run this and I'm seeing a nice smooth update and you're seeing probably something jumpy but I'm just changing that that parameter so this this isn't necessarily how it be used but but how it's pretty powerful so I'm changing this parameter and creating a new model and a more common thing would be I have a family apart so I have this part that represents a whole family of different sizes and so I might have tho that defined in a table and then write a program that would read that table and then assign those values to the correct parameters to create this new variation of the part so I could automate building those families so let me shouldn't say come in if I can get my window fear just to read it there we go and so there's a question if we plan to allow executing add-ins without launching the fusion 360 desktop app and that so there there aren't any immediate plans for that so so today as I said the API runs inside the desktop and so the desktop has to be running to use the API there is some functionality and it's it's in the help in that overview there's a section called the I think inserting parts from a web page or something like that but it it's a way kind of from outside fusion to start up fusion and but but the fusion client has to be running to access the API so there are some long-term plans to have fusion running on the cloud like you saw with the design automation API with AutoCAD now to have you know something similar to that so that you could control fusion that's running on the cloud and so you wouldn't have to have a desktop version of it running but today that that's it and so that so a good follow-up question to that is what about running fusion in the background and today it you can't so it's always going to be visible and come up so there were some things I don't know if you're familiar with inventor or not but it used a comm so some functionality from Microsoft called comm and specifically comm automation API and we got a lot of that stuff for free at that point just by using that that type of API so you could start inventor but tell it to start and visibly and then you could still talk to the API and drive it but we don't really have a way to to do that today with with fusion so so the are some limitations there let's look at a couple of other samples and then maybe call it good so here's one that demonstrates being able to query the model and so here I have several instances of a component in different orientations in the assembly and then I've written this command called cork all holes so this is an add-in so when I loaded an inventor or loaded fusion fusion found the add-in and ran it and the add-in added this new command to the assemble panel and so this add-in is running in the background waiting for this command to get executed and so I run it and it has a dialog really simple dialogue but it's asking me to pick bodies and so I'll maybe pick these two and then click OK and what it's going to do is it's using that part of the API I talked about early to be able to interrogate a solid model so it's not looking for features because this this could have been read in through say step and so there aren't any features it's just it's just looking at the shape of the model so it's looking for basically circular edges and then doing some additional logic to figure out which ones represent hulls and which ones represent bosses so notice what to ignore but so if I click ok so now it's processing away and so it found that all the holes and their sizes and then built new models that represent these quarks and it added joints so that the court has to stuck in the hole so a really useful program undo the drag because I moved the model around but you can see here undo cork all holes so my command was called cork all holes and so everything that that command did is in a single undo so if I undo so there's undo the move and do a move and the next one is to undo the corks and there they go so let's see so there's a new question they add in with Sigma symbol as part of fusion or is available as a sample and I'm not familiar with that add-in so I can't really say but if you'd like to to email me maybe I can find out more about that oh I see so this that the question was about this symbol right here is that part of fusion and so this isn't this is just a fusion command so yeah you're not seeing it in your version of fusion just because by default it's not there this is what you're seeing in your fusion is just the the modify panel and what I did because I use that command a lot is this is just part of fusion is if you go to a command that's in the panel you'll see this little curly arrow next to the and all of the commands and I just click that and then that moved the command up into the panel so any commands that you use frequently you can put those up there or if there's some commands that fusion put up at the top and you don't use those frequently then instead of the little curly up arrow there'll be an X so you can remove it from the main toolbar so it's still in the drop-down you still have access to it but it just lets you manage what's in the top level all right so let's a look at that and another sample so this this one is kind of fun it's something see let me do this one it's something we did for the the forge conference with a couple of partners and so we had the these stools that we that had been machined out of solid piece of big sheet of plywood and but then we wanted people build a customized design for the the top of the seat and so we wrote the this little program so got several commands here and you can see so this is an add-in and you can see that you have really full functionality like a built-in command to build to nice command so I have these previews that that show up and anyway I'll to show you a couple things so this was to try and make it easy for non fusion users to create sketches basically so if I do this mesh command so it's just drawing lines and a mesh shape and they're kind of randomly place the the points on on the mesh or I could say I don't want it random and get a nice rectangular mesh but and then if I click OK it just great sketch geometry that's like that and there were some other shapes that I could do and then at the end I could say cut C and basically this then there's a Python program that would read the sketch geometry and convert that into to G code and send it to a machine where we would cut the top for that so just another example of the of the API and then let's see and it's these command inputs so different ways to get input from the user right okay so I do encourage you to go to that the help page to read more about it and oh one more thing so this scripts and add-ins command and so here is where I access all of my existing scripts and add-ins but what I want to really point out here is there some sample scripts and add-ins that come with fusion so you can look at some of those and play with them and for example here's the gear example that's talking about and I'll just run that and there we go so I encourage you to look and I thank you for attending and if you have any questions the the fusion customization forum is the best place so so thank you
Info
Channel: Autodesk DevTV
Views: 2,381
Rating: undefined out of 5
Keywords: Fusion 360, Autodesk, Mechanical Design, Cloud, Product Design, CAM, CAE, Simulation, Collaborate
Id: Va8zIfqWzMc
Channel Id: undefined
Length: 69min 33sec (4173 seconds)
Published: Wed Oct 12 2016
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.