Description
Key Learnings
- Learn how to more effectively model with Fusion 360 by fully understanding what a component is
- Understand the difference between a component and an occurrence
- Gain a basic understanding of how a matrix is used to position components in an assembly
- Understand what a proxy is and why they're important
Speaker
- BEBrian EkinsBrian Ekins began working in the CAD industry in the 1980s and has worked in various positions, including CAD administrator, applications engineer, instructor, CAD API designer, and consultant. He has worked for Autodesk, Inc., for the past 17 years. He is the designer of the programming interfaces for Inventor Fusion 360 software, and he also supports developers and customers in their use of these technologies. Brian also enjoys designing real-world things and writing programs for fun at home.
BRIAN EKINS: Let's go ahead. So there's a couple of you I know, but there's a lot of new faces here. So just give a little introduction.
So before I worked for AutoDesk, I worked for Intergraph, who doesn't exist any more. Well, they got bought by another big company. But at one time they were a big CAD company. I worked there for 13 years. I was an application engineer for a long time.
That's when systems were really expensive, and companies would invest a lot in doing benchmarks and showing customers that the software could do what they wanted. And I kind of specialized in really complex modeling. And I did a lot of customization to customize the software to do what the customer wanted to do.
And then Intergraph started developing Solid Edge. And since I was really kind of an end user of the software they had before but did some programming too, they talked me into designing the API for Solid Edge. And so that was totally new for me, a new experience.
So I did that, and then I moved to Autodesk. And I've been at Autodesk now for a little over 19 years. And so at AutoDesk, I designed the API for Inventor. And I moved around a little bit in Autodesk, too, so I was part of AutoDesk developer network supporting developers using the APIs, and also was in the consulting group for a little while writing stuff for customers. And now I'm working on the API for Fusion. So I'm the designer for that.
So maybe a little bit about you guys. So who uses Fusion here? So you're using it or looking at it, I guess. And this is just kind of curiosity for me. Who uses CAM inside Fusion? Anybody here use Inventor too? OK. Most, all right. So that was a question. So since it's most of you, I can relate some of this stuff to Inventor, too, and just maybe save you guys some time.
So this year for AU, I submitted three classes. But I did proposals for three. But I said I only want to teach two. Two's enough. Three is just crazy. I did it one year and never again. But this year people got to vote on the proposals, which ones they want. I don't know if you saw that, but it was new that they did this year. So I said I'll submit three. I'll do the Fusion one, and then whichever one gets the most votes for the Inventor one.
And it happens that the Inventor one is almost the same class, just twisted around for Inventor. So if you're here for this one, you might want to skip the Inventor one. But there are some differences, and so I'll bring that up when we get to it.
Who here has used the Fusion API? OK, a couple. All right. So like I say, my emphasis is on APIs, and so we're going to be looking at some API. But as just a user, I think you'll get a lot out of this, and I'll go into that in a second.
So who would be interested in using the API? OK. And so this is what I hope you get out of this is to be able to model more effectively, and mainly just by really understanding the internals of Fusion, have a little better idea of what's actually going on, and know the difference between a component and an occurrence, which you might be going, well, what's an occurrence? And so we'll talk about that because it'll help you.
So the first two are just general usage issues, so should benefit everybody here. And then the next two we start getting into more programming specific stuff. What's a matrix? So these are things that I see people struggling with, so that's what I wanted to talk about here. And then what's a proxy? And we'll talk about that.
So components. Get a couple notes out here so I don't forget stuff. But so components, just using Fusion, you see they're a key component, or a key part of Fusion. You see the name component show up all over the place. So it's a critical part of Fusion.
But I found that it's kind of-- that was my next thing because it is confusing because Fusion overloads this term, uses it for things that really aren't components. And that's what we're going to spend quite a bit of time on. And so I see people struggle a lot with this, so that's why I want to go into it. Yeah, Fusion is confusing. And the UI kind of lies to you in a few cases, and that's where it can get confusing.
And it's especially critical to understand this when you're using the API, too. In the UI you can kind of struggle through it, and you don't really understand why something happened that way, but it worked, so you just keep going. But in API you've got to know what's going on.
So what is a component, first? Does anybody you have a-- what would you define a component as?
AUDIENCE: Part of the whole. Individual parts.
BRIAN EKINS: OK, that's a good one. And there's not really an official definition, so your definition is as good as mine. So I just said a grouping of modeling information. So here's another analogy, maybe, that can help, is so we can look at it as a container, a component as a container of some stuff. And so here we've got some containers that contain different stuff, and containers can contain other containers.
And so let's look at the containers inside Fusion. So the big container that holds everything is the document. So that's the f3d file that you read from disk or bring in from the cloud. And then what it holds is something called a product. And as just a user of a Fusion, you're not aware of this, really, but in the API you have to be.
And so the API calls these things a product. And what that is, so there's a CAM product. And so think of this, again, as a container. So we've got this big bucket that's the document, and inside it is a bucket that contains just the CAM data. So that's the CAM product. There's another bucket that contains just animation data, another bucket for every simulation study. And there's another container for the design data.
So these are different products. So inside the f3d it's divided up, so each one of these different areas of functionality has its own data separated from the others in its own container. So we've got the document, we've got the design. So that product, that design product, contains parameters. It's one of the things that's inside that container, and it contains a component.
So I've got a question now with components. So are components parts or assemblies? I get a yes over here. Yeah. They can be both, which I think maybe sometimes is a little bit confusing. That's a big difference between Fusion and Inventor. In Inventor you create a part document, and it has to be a part, or you create an assembly document and it has to be an assembly. So there's no confusion about what's what.
So Fusion doesn't differentiate. There's just a component. So what's a part, then? What would make a component a part?
AUDIENCE: Just a single [INAUDIBLE]
BRIAN EKINS: I guess when you just think of a part, a physical part, what are you what are you modeling there?
AUDIENCE: That doesn't [INAUDIBLE] doesn't disassemble.
BRIAN EKINS: OK. Yeah. Usually it's a single thing, right. And so I think of a part as really what you're trying to get to is that final body that represents the shape of the part. And then you've got kind of construction stuff to get to that point, sketches, construction planes, axes, whatever you had to do to define that. But you're trying to get to that single body.
And then what's an assembly? Combination of parts or other assemblies, too. So Fusion lets us mix those two, but it's not a good idea, really, to mix it. In the real world, what does that mean? I have this thing that's an assembly and a part together. And so it doesn't really make sense. So you can do it, but it's best to create a component that's either just a part or it's just an assembly, and we'll look at that a little bit more.
So here I'm illustrating a component that's representing a part. So a component's a component, but here we're going to just talk about stuff that might be in it if it's a part. So it would have things like features, the construction geometry, it would have the resulting body. And it has parameters, too. So these are user parameters that exist at the design level, and these are model parameters that exist inside the component.
And then the component contains a sketch. The sketch is kind of a special one because it's also another container that contains all that kind of stuff. So we just got container and container and container. And so let's look at a-- so you can see a little bit of code here.
So here's Fusion with a part. So we've got a few sketches. One body is the result. And here's a little program I wrote. And all these programs are in the notes. But I'll explain-- so some of you haven't used the API before. It is kind of navigating these containers that I just talked about.
So in the API, the very top level thing that we get is called an application object, and that represents all of Fusion. And that's what I'm getting here is I'm getting this application object, and then from it, I get whatever product is currently active in the UI. And I'm assuming that the user has a design open. He's not in CAM but he's in one of the modeling work spaces. So that's what's active.
So here I'm getting that design container, the API wrapper for that. And then from the design, I'm getting the root component. We'll talk about that in a little more detail in just a second. But I get a component, and then from that component, I am querying it. So I'm getting how many features are in it, how many construction planes, axes, points, sketches, bodies, parameters. And so let me go ahead and just run this.
So it ran, and it displays the real results in this message box. So that's what's in this component.
So an assembly component. So what's inside it are these kind of things. An occurrence we'll talk about in a second because again, the UI only talks about components. So construction planes, axes, and points could be relevant in an assembly, too, to help you position occurrences and then joints, rigid groups, those kind of things.
So an assembly is just defining structure. You've got your parts and then you're using these other things to position the parts in the assembly.
So let's go back to Fusion here and just create a new file. And so I've got a new document, and I have a design. So a Fusion document always contains a design product. So this one is just empty, but it's always there, and the design always contains at least one component. And that's represented by this top node here. So this one is empty because it's a new file. And this one is a special component, and we refer to it as the root component. So it's the top level component, always in the browser.
So we've got the root component. And so now if I, say, create just a simple sketch, we extrude that. So now I've added some things to that root component. So we've got the sketch. We have that body. And now if I do this, create a new component, and then we add this [? primitive ?] to that. What did I just do wrong?
AUDIENCE: You wanted to [INAUDIBLE]
BRIAN EKINS: Yeah. So this was active, so the body's down here. I kind of broke my rule that I said before, is I've mixed a part with an assembly. Now my root has part data and it has assembly data, and so it's not so good. What is that thing, really? Why would a bomb show that, my root?
So it would be better to do-- so if this was just going to be a part, everything could live in that root. But if I want this to be an assembly, what I should have done is create a new component, draw the stuff in that one, then create another component, draw some stuff in that one. So now my root is a pure assembly and not a mix of part and assembly.
So let's look at something. So when I do this Create Component-- so in the UI, I can activate a component, so that's the little radio button. So here root is active. Here this component is active. And what that means now is I draw stuff in the UI. It's going to go into that component's container.
So if we expand this so I have that sketch that I built and that body is inside that component. So when I did that new component, what really happened? So a new component was created, and it's something else. So I'm going to use this. So this is going to represent our root component, the coordinate system of our root component. Red, green, blue.
Can one of you guys help me? So maybe just stand here or just hold it up. Yeah, that's OK. So this half of the room is our root component. And so we draw a model in it. And we draw it relative to the coordinate system in there. And so there it is, and that's what we would be seeing on the screen is this model. And that's my real body that I've built in there. And-- yeah, for a second. It'll move in a second, yeah.
So that's the real thing there. And when I did that Create Component, it's now creating another component. It's still in the same document. You want to hold that one up?
AUDIENCE: Sure.
BRIAN EKINS: OK. So now we've got this other component, and so I can just take that. And so we're creating an assembly now. So we created our root component like I did here. And then I create a new component, and now I'm drawing this stuff inside this component. So that's OK.
But there's something that in the UI, I can only see what's in the root component. I only ever see what's in the root component. Why am I seeing this? That's because something else was created, and that's an occurrence. So any component besides the root component is often some back room. I never really directly interact with this thing.
And another analogy for this is think of just a really good hologram. So I've got this real thing in some back room, and then I project a hologram of that into my root component. So I see that there. And that comes in as an occurrence. So I'm going to represent an occurrence as another coordinate system. So now I've got this coordinate system that's positioned relative to this root coordinate system.
So an occurrence has two things. So it has a position inside this coordinate system. And it also has a reference to some other component. So this guy is referencing that and its position in here. So I can position it any orientation I want, move it around, whatever, and it doesn't affect that. That guy doesn't even know it has a reference or where this is positioned. It's a reference going in that direction.
AUDIENCE: Multiple references, yeah. Right? Multiple?
BRIAN EKINS: Multiple? Yeah, so we'll get to that. Yes. Good question. So that's an occurrence. And so now if I make a copy of this, my last one. Yeah, so we can have multiple references. So I think I'm turned around but it doesn't matter. So these can be independent of each other because each occurrence is unique, but they're both referencing that same real part inside that component. . You guys can put them down for a second. I might come back to them. So does that make sense?
So if we go back to Fusion, to when I did the Create New Component, it created the component off in that back room and created the occurrence at the same time. And what this really is in the browser, that's the occurrence. So it's really a reference to component one. And it has this colon one saying it's the first reference because now I could do a copy and paste if this is active. Copy and paste.
So now I have two occurrences. So they're both referencing component one, but I have first instance and second instance. So if I want to edit these, I can, so I can say I want to put a fill it. I pick this, so I'm indirectly editing the component that was over here, the real component. But that's just being reflected. The hologram that I'm seeing over there is showing me what's happening over here. And so I see that change happened to both of the references That make sense?
So any change I make, I'm changing the real component, and then I'm just seeing a reflection of that through the occurrences. There's a couple other things that make a little confusing in the UI. So here, let's say I want to move, so I grab this and rotate it. This usually defaults to this. That's what I meant to do. So ignore that I changed that.
So a lot of times you think I want to move one of them, and both of them move. What's happening here is I'm moving the body. And so I am really moving this thing over here, and so that gets reflected in both of the instances over there.
So you just have to be careful. But if I do component, which that really should be occurrence, is this where the UI keeps lying. So if I pick this, now I'm just moving that occurrence. And that's what happens, actually, if I just click and drag, too is-- why isn't it letting me drag? If I do that, I'm just moving the occurrence.
One other thing, too. So an occurrence lets you define-- it defines the position of something in the root component, and it defines what it's referencing. And it can also define some overrides, too. So for example, I can change one of these to red and not the other one.
So that's happening at the occurrence. So it doesn't change my original one. It stays green. And it doesn't even know any change happened. But then when that occurrence redraws that perfect hologram over here, says, oh, I'm going to recolor it to be red.
But sometimes this gets confusing, too. So if I say appearance, and here it's saying bodies and components. Let's get a red one, and so I'll just drag it onto here. And they both go red, so what's going on?
Same thing, right? I really ended up-- in this case, I assigned the color to the real one. And so they both got reflected. And it's hard to do in the UI, so if you want to do any of these color overrides, it's best to actually come over to the browser. And then you can more easily pick that occurrence instead of the body that's underneath it.
So that's the first half. That's kind of the first two things is what's the structure of a Fusion document, and then what's the difference between a component and an occurrence. Now we're going to dig a little more into API stuff. So hang with me on this.
So I said that an occurrence defines a position in the root component. And in the API, the way that you specify that position is using something called the matrix. And so that's where we get a little deep. You have to decide red pill or blue pill, so if you want to hang around or not. So a matrix. So what is a matrix?
So it's pretty simple conceptually. But to put it into practice, it starts getting a little trickier. So it's just a rectangular array of numbers like this. And a 3D matrix is actually a four by four matrix, so 16 numbers. So how does that define a coordinate system?
And so here we have a coordinate system, and how it is, so this first column defines the direction of the x-axis. Second column, the y-axis, third, the z, and the last one, the origin. And then the bottom row of numbers we just don't use.
And this matrix thing, so Fusion Inventor does the same thing. So this is just exactly the same in Inventor, but Autodesk didn't come up with any of this. It's just a typical computer graphics way of defining positions in 3D space. So this is how it does it. But let's look at an example to see how it really applies.
And actually, this matrix that I showed here is a special kind of matrix referred to as an identity matrix. And the reason for that, if we look at this, so how this defines an axis is this is a vector. And I'll talk about vectors a little more on the next slide, I think.
But this is saying that the x-axis goes one unit in the x direction, zero in the y, and zero in the z. This one, zero on the x, one in the y, zero in the z, zero x, zero y, one in the z. And the position is that zero zero zero.
So this defines a coordinate system that's x is in x, y is in y, z is in z, and it's at the origin. And that's called an identity matrix because it lines up exactly with the world coordinate system.
So let's look at this example. So I have drawn this part. That corner is at zero zero zero, and the long edge of it lines up with the x, and then up with the y and z. And I want to move it so that it's three units in the x, five, and rotated 45 degrees. So how would I create a matrix that defines that move, that position in space? So let's look through that.
So I said that those columns are vectors. So let's do a little primer here because it maybe has been a while since you thought about a vector. So what is a vector? So it's just a direction. And we define it using x, y, and z parts of it.
And here we say we want to move three in the x, five in the y, and zero in the z. And so we end up at that point. And it's a magnitude. So it's that total distance that I ended up moving. So that's what a vector defines is just a direction and a magnitude.
And something I see people get confused about a little bit is it doesn't define a position, really. So let's say we had a vector where I was telling you to move two steps up and one step to the right. So that's my vector. So let's say up is x. So two, one, and zero, because I didn't tell you to jump. So I could give that vector two, one, zero to anybody. So I could say move two steps up, one step to the left, and over here, two steps up, one step left.
So it's just giving a direction because that direction can apply from anywhere in space. So direction and how far. So that's really what a vector defines. And so now we need a 45 degree vector. So we want to define a coordinate system. So we want that to be 45 degrees. And so I need this vector to go in that direction.
And so what would be a vector that would define that direction? So that would do it. I want to go one unit over and one unit up, so that works. 5,000 over, 5,000 up. That works. Little bit, little bit. That works as long as it's the same in both of them. But for this kind of thing we're doing here, it has to be one unit long, the vector that we're going to define. And that's referred to as a unit vector where it just means it's one unit.
So a unit vector is really defining just direction. And since it's always one, then the magnitude doesn't matter. And so we need a vector that is one unit long in that direction, and that ends up being 0.707.707. They end up moving one unit. And how we get that .707, and then we have to drop back to trig a little bit.
So we've got one because that's what our unit is. So one 45, cosine 45 and then sine of 45. So I could do that for any angle with that. And then that's where we end up with for that vector.
So there's some rules for the vectors-- well, rules for this coordinate system, anyway, when you're defining a coordinate system to be used for an occurrence. So one is the one we just talked about, that each of these vectors has to be one unit long, and they have to be 90 degrees to each other.
So I can't have my z-axis shooting off like that. So they have to be, each one of them-- so we've got 90 degrees there, 90 degrees there, 90 degrees there. They have to be 90 degrees to each other.
And then one other rule is it has to be a right-handed coordinate system. And so what that means, so assuming red is my x and green is my y, so I take my right hand, go in the direction of the x, and then curl towards the y. And now my thumb is pointed along the z-axis. So this is a valid right-hand coordinate system. If I had my vector pointing that way, that's not right.
So it can be either this way or this way. If these are 90 degrees to each other, and this one has to be 90 degrees, so those are my two options for it to be right-hand. That's the right option. So those are my rules in defining the coordinate system.
And so here, start filling this out. So in this matrix, I've got the origin is three, five, zero, so that'll end up moving the position of this coordinate system with respect to the other one. So three, five. And then we want to rotate it.
So here are the vectors we just talked about. So the x is 0.707, so 0.707 0.707 And the y is minus 0.707. And then z is still straight out at us, just zero zero one, so we're just rotating about it. So now if I apply that matrix to this occurrence, then that part moves up to that position. And I can show you actually what that looks like in code.
And so here is that part. And here is the program to do that. So I'll just quickly show what's happening here. So here I'm calling a function to have the user select an occurrence. And so now I have that occurrence as an API object. And here I'm doing some of the math to just build those vectors. And inside the API there are objects that represent a vector or a matrix or an occurrence or other things. So these are more just helper things to be able to call other APIs.
So this doesn't ever show up visually inside Fusion. And it's not something that's saved with the document. It's just something you use temporarily in your program when you're working with some of these mathematical related objects. So here I'm creating a 3D vector. There are also 2D ones, but this is always 3D, and I'm getting the cosine and sine of whatever the angle is.
Usually on computers, angles are done as radians, not degrees. So here pi is 180 degrees and I'm getting 1/4 of that, so 45 degrees. So my angles 45 degrees and I'm creating a vector, so that vector, that x vector we've got. And then the y vector is 135 Degrees, so 3/4 of pi.
So now we're pointed that direction. The z vector's just still coming straight out. And then the position. So that's defined by a point in space. And I'm creating this guy, point 3D. So that's, again, not a real point. That doesn't show up as like a construction point or a sketch point. That's just a programming thing to wrap these coordinates.
And then here I create a new matrix. And when I just call it create it, it creates a matrix and returns it. And by default, it's an identity matrix to start off with. But I'm going to reset it completely and call this function on the matrix that I got back to say redefine that with this information. So it's setting that data in those columns that we talked about using the information I got here.
And then the occurrence that was selected up here, it has a function on it called transform this property. And I'm pushing that matrix into it, and let's see what happens. So I just this, and it's asking me select an occurrence, so I pick that, and boop, up it goes. And I could query that, too, to find out where the occurrence is in space, too. I would get back the matrix, and then I could look at the values inside it and see where it's at.
So now the next thing that people really struggle with, and I can understand why. It's a little bit of a brain twister sometimes-- is something called a proxy. So as we said before, so I've got over here, in this component, is where the real body lives. So there's only one of those bodies. But then over here in my root component, I see two of them. And these don't really exist. They're just reflections of that.
But in this assembly, I can pick those. It's a perfect hologram. I can check for interference between other things. I can measure it. And so what is it that I'm picking when I select, say, this face? And what it is, it's a proxy. And so this face doesn't really exist. It's over here. So the thing that I pick here is representing this face as if it exists in the assembly.
So this is something you don't really care about as a user because it just works, and that's what's nice. And you don't really have to care at all. But as a developer, sometimes you need to know this, but not always. And I'll show you in a second.
So I have these proxies that represent the real thing that's in the other component. And I'll show you how, even as a developer, you don't have to care a lot of times. And I've got another sample here. This one's pretty small.
So here it again does the selection, and it's going to ask me to pick a face. And in this function, Select Entity, so this is a prompt that it's going to give me. And then I can specify what kinds of things the user can pick. And so I'm saying you can only pick cylindrical faces. So I'll get back a cylindrical face here. And then from that cylindrical face, I get its edges. So for a cylinder I just have the edges on the end. And I'm assuming it's just a nice cylinder, not cut with some weird angle, so that I'm going to get circles back.
And then from those edges I get the geometry, which is going to be a circle, and then from the circle, I get a center point. So I have the two centers and then I just display where those centers are in space. So let's back to Fusion.
So here's that assembly. And so I've got these two occurrences. And I'll run this. And so it's saying select a cylinder. Let's say that one. So 5.08, 5.08. So that's the one to remember, 5.08. And I'll run it over here again. And let's pick this one. So 20.32. So that's the right answer. And I didn't do anything special here.
So if I, say, broke the rule from before, if I create a body inside the root, and I run this on that, I can pick that cylinder and iy reports on it, too. So it doesn't care. The program isn't doing anything special if the geometry is a proxy or the real thing. So when I picked this cylinder, that's a real body. That's the real thing. But when I picked this one, that was a proxy to the real thing.
And the program doesn't care. It didn't do anything, because what happened is, in this selection, Fusion returned the proxy for that cylinder, and that proxy knows how to behave like the real thing. And so it returned the answer back as if that really existed. So it's kind of like in the UI. You don't worry about if it's proxy or if it's a real thing. It just works. And that's what happened here through the API too.
But there are some cases where you do start to care about this, and we'll look at one. So I've got kind of a bigger program I wanted to step through and illustrate a few concepts, and then why you would care about a proxy. But just before I do that, let's do one more thing here. So that's what I just demoed.
So in Fusion, the reason that program work is the same object is used, whether it's a proxy or not. So I got a face object back. And it's a face, but it can represent the real thing or a proxy.
And when an object is acting as a proxy, it supports three additional things. And what those are is the first one has a property called native object. If it's not a proxy, this will just return nothing. But if it is a proxy, so if I have this face and it's a proxy and I call its native object, then it will give me this face. So it's the face that the proxy is representing, whatever object it's representing.
It has this property called assembly context. And what that returns is so this guy exists through this occurrence in the root. And if I call assembly context, it would return this occurrence. So what occurrence is this relative to inside the root? And so this one is a different occurrence, so it would return a different occurrence.
And then there's this method, which I'll maybe explain when we look at the code. But this lets me create a proxy. So if I have the real thing, but now I need a proxy in the assembly, this lets me create that. And so it's not commonly used, but it does come up.
So what a proxy is really is it's just a path to the real thing. So here we've got this. And so I have this proxy. So what it is is it knows which occurrence it's relative to and what the real face is there. And so the path is this occurrence, and then the face. And so the other one that I had would be the other occurrence and the face. So they're unique proxies because their path is different through a different occurrence.
So let me just step through some code here. And this is a bigger sample. Still not huge, but bigger. And maybe I'll give a couple of pointers real quick on just debugging a program inside Fusion. I need to do a video or something on this because it's pretty simple if you know these steps. But it's not obvious what the steps are.
So here we've got this program. And let me just run it and you can see what it does. So it creates a new document, creates a new component and occurrence inside it. And then inside that component, it creates a wheel and an axle and another wheel. So two instances of this wheel and one of the axle, and it places some joints in between. So it created all this from scratch just then.
And so I'm going to run this. And so in Fusion, you have scripts and add-ins. And the big difference, scripts I run from this dialogue. And add-ins would tend to be run automatically by Fusion when Fusion starts up. And then they keep running through the whole session. And so it's a way for you to create more elaborate commands and things, where a script, I would pick up from here. Say it runs and it's done, downloaded, and that's the end of it. How did that happen?
So this is a script. And a script, let me show you how you get to that. So I got the add-ins, I picked this, and then I said Edit, and then that opens up this development environment. And I can just start running it. I can start debugging by clicking this button. And what it's done is it's running now and it stopped at this first line. And I can step through it. But what I've done is if I double click over on this left border, it will insert a break point, and then I can just say run. So now it's run and it's stopped here. And now I can step through.
So now the program is actually running, doing its thing, we're stepping through it. So here it's creating a new document. And I got the design container from it, and then I got the root component from the design. And here I am adding a new component.
So what I'm doing is on the occurrences, I'm really saying I want to create a new occurrence by creating a new component. And so this is going to create a new empty component and an occurrence that references that. And I have to pass in the position that I want that new occurrence. And so here I'm just passing in an identity matrix. So it's going to show up right at the origin.
And then from the occurrence that just got created, I'm getting the component. So that component that was over here, I'm getting it, and I'm going to rename it to be Wheel Axle Assembly. And so now inside the wheel axle assembly, I'm getting the occurrences inside it, and I'm adding a new component. So again, it's creating another new component, so it's off on this side, and an occurrence inside this wheel axle, axle component.
And then I'm renaming it. And now inside that wheel component, I'm going to draw some geometry. So I'm creating a sketch and drawing a couple of circles. So the outside of the wheel and the hole for the axle. And now, interactively, if I create a new sketch and I draw a circle in a circle, and then I run the Extrude command and I move my mouse over there, I can pick either that outside ring or I could pick the hole in the middle.
So those are profiles, they're called. So there's two profiles available. And this is a little bit of logic. I want to find that profile that's outside. That's the one I want to extrude.
So I'm finding the profile that has two loops to it, two boundaries, where the inner one just has one boundary, or the outside one has this outer boundary and the inner boundary. So this is just looking for the one that has two loops and then it's doing the extrusion.
And here's something that may be a little confusing. And so if I go back to Fusion, actually, that's the first one we built because we haven't finished it. So I'm not seeing anything happen back here. And the reason for that is the main part of Fusion is single-threaded, so the UI is all in this one main thread, and the API also runs in that thread.
So right now the API has kind of blocked Fusion. So it's not getting a chance to paint anything. And I can actually give it a chance for just a second. There's a function inside the API called Do Events, and that just lets Fusion take over the thread for a minute to do whatever's pending.
And so now if we go back, that's really where we're at. So a new document has been created. This component's in it, and it's created the wheel component inside that. I can't open it up because we're locked up again. So it is working. And then I get the body that was just created when I did that extrusion. So now I have the body. And that's the real body over here, not the proxy.
And so this is a difference between the API and the UI. In the UI, I can never directly access this real body if it's built outside of the root component, where with the API, I can. I can get to the real thing. And that's what just happened here, is that body I got back is the real body in another component.
And so now it's going to do basically the same thing but build the axle. And then from the axle I get the outside edges from it. And these are the real edges on the real axle. And then it's doing some stuff to find the real edge of the wheel. So I should have brought a wheel and an axle.
But let's say now I want to put some kind of joint in between these two. And these are both the real parts that I have. Well, actually I just have one. I have one real part. In the assembly, I see two. But right now what I've got is just this one. So I have this one edge.
So in the assembly, I say I want to create a joint between this edge and this edge, and then these go together. But I really just have one edge. And if we had a program like this that built this part, so I just build it, and I have this edge over here, the real edge. But now, to create a joint, I need these two proxy edges in the assembly. That's what the joint needs. And so that's where this call comes in, create for assembly context.
And so I have the real edge. And then I can say create a proxy for that relative to this occurrence. And so now it returns this edge as a proxy. And then I can do the same thing, create the assembly context, so create a proxy for this edge relative to this other occurrence.
So now I get this proxy. And then I can call the joint stuff and actually create a joint between those two, and it'll go together. So that's a case where you have to kind of create a proxy because I can get the real thing, but then to use it in Fusion, I need to have a proxy. Everything needs to be relative to the root component.
So does that kind of make sense? So that's really what I've got, other than I was going to take advantage of you being here and ask a couple of questions. So I already asked. So not too many-- a few of you are using Fusion 360. So how many of you are using Python that are programming?
AUDIENCE: Dynamo. For Dynamo.
BRIAN EKINS: For Dynamo? And so Fusion comes with that developing environment I was using. It's called Spider. So does anybody here like Spider that's used it? Does anybody say they don't like it, or it's OK? I probably fit into the it's OK. When I first started using it, I didn't like it. But things just grow on you. You get used to stuff. But I don't know if anybody would say they like it a lot. But it has issues. And so we're looking at maybe replacing it, and this is what we're playing with right now.
OK. I wanted to get some opinions because these kind of changes are sometimes a little bit painful. It's just a change. Any kind of change can be painful even though it's for the better, I think. But we're not 100% sure. We're still trying to figure out a few kinks.
AUDIENCE: [INAUDIBLE]
BRIAN EKINS: For which?
AUDIENCE: Spider is only for Python, [INAUDIBLE]?
BRIAN EKINS: Yeah, Spider's just for Python.
AUDIENCE: For C++?
BRIAN EKINS: Asked if we could use Visual Studio Code for C++. And we haven't looked at it for C++. It might work, I don't know. don't know on that.
AUDIENCE: Do you actually make use of the Visual Studio for Python rather than using [INAUDIBLE]?
BRIAN EKINS: So Fusion just supports-- you can use Python or C++.
AUDIENCE: So you just basically [INAUDIBLE]?
BRIAN EKINS: Yeah. Right now Visual Studio Code will be used just for Python. Yeah, I don't know if it could be used for C++. I kind of think probably not for debugging. I don't know. It supports almost everything, but I'm not sure about if we can make it work for debugging.
So that's what I had. Any questions? I hope it was useful. I think I see a lot of confusion, especially with the occurrence versus component thing. And hopefully when you're using Fusion, things will be a little clearer now. All right, well, thanks for coming. Appreciate it.