We need your feedback!
Please take the following survey after completing Lab 3. As you go through the lab, remember or write down how helpful each video is, what could be made better, what you struggled with, etc. We will take any feedback we can
Please take the following survey after completing Lab 3. As you go through the lab, remember or write down how helpful each video is, what could be made better, what you struggled with, etc. We will take any feedback we can
Lab 3
Lab 3 will introduce you to parameters and assemblies. You will be able to import a part, access and change parameters, and assemble components using joints. You will use your knowledge of parameters to change an existing pulley, and assemble the pulley to an existing cylinder.
Objective
Create an understanding of parameters and assemblies.
Deliverables
Deliverables for Lab 3 will be a script that will take an existing pulley, change its parameters, and constrain it in an assembly. As you work through the lab practices you will be completing the lab deliverables. See the open lab section at the end of this lab for some hints which may assist in your script.
Lab 3 will introduce you to parameters and assemblies. You will be able to import a part, access and change parameters, and assemble components using joints. You will use your knowledge of parameters to change an existing pulley, and assemble the pulley to an existing cylinder.
Objective
Create an understanding of parameters and assemblies.
Deliverables
Deliverables for Lab 3 will be a script that will take an existing pulley, change its parameters, and constrain it in an assembly. As you work through the lab practices you will be completing the lab deliverables. See the open lab section at the end of this lab for some hints which may assist in your script.
Import
The Fusion 360 API can be used to import parts. The file to be imported must be in the same folder as the script being run. For Lab 3 you will be importing an existing pulley, then you will modify its parameters, then constrain it in an assembly.
The following video shows how to import an existing file.
The following video shows how to import an existing file.
Lab Practice
Create a function that uses the API to import a file containing a pulley. Import the file as a new component in the current design. The file to be imported can be downloaded by clicking the button below. Download it and put it in the same folder as your script file. This line of code will give you a relative file path to the pulley file assuming it is in the same folder as your script:
filename = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'SquareToothPulley.f3d')
Parameters
Dimensions or other measurements added to a model are called parameters. As these parameters are changed, the part will update accordingly. There are several types of parameters, including model parameters, user parameters, or linked parameters. You can follow this link to learn more about parameters. We can use the API to access and change these parameters. For example, we can take an existing pulley and change its parameters to increase or decrease its size, number of teeth, etc.
Lab Practice
Create a function that will change some of the parameters in the pulley. The parameters in the part file that you will need to change are called “teethNum” and “shaftDiameter”. Your function should accept 2 parameters, one int and one float, to be assigned to those two model parameters respectively, and a parametersList object to pass in the parameters from the part. Set “teethNum” to something between 12 and 20 and set “shaftDiameter” to 0.5 cm. Also, add a line to the end of your import function that will return the occurrence of the newly imported part (it should be the last one in rootComp.occurences).
Create a function that will change some of the parameters in the pulley. The parameters in the part file that you will need to change are called “teethNum” and “shaftDiameter”. Your function should accept 2 parameters, one int and one float, to be assigned to those two model parameters respectively, and a parametersList object to pass in the parameters from the part. Set “teethNum” to something between 12 and 20 and set “shaftDiameter” to 0.5 cm. Also, add a line to the end of your import function that will return the occurrence of the newly imported part (it should be the last one in rootComp.occurences).
Assemblies
Lab Practice
Model a cylinder in Fusion 360 with a diameter equal to that of the pulley center hole (0.5 cm). Then using the API, import a pulley and constrain it to the cylinder you just created using a rigid joint. You will need to constrain the cylindrical face of the center hole on the pulley to the cylindrical face of the cylinder you created. You will need to get the proxy of the face of the center hole on the pulley. You can modify your import function return the face proxy once the pulley is imported.
Model a cylinder in Fusion 360 with a diameter equal to that of the pulley center hole (0.5 cm). Then using the API, import a pulley and constrain it to the cylinder you just created using a rigid joint. You will need to constrain the cylindrical face of the center hole on the pulley to the cylindrical face of the cylinder you created. You will need to get the proxy of the face of the center hole on the pulley. You can modify your import function return the face proxy once the pulley is imported.
Open Lab
Objective
Create an understanding of parameters and assemblies.
Deliverables
Deliverables for Lab 3 will be a script that will import an existing pulley, change its parameters, and constrain it in an assembly. This parametric pulley file is provided for you to use for this lab. Download it and put it in the same folder as your python script.
Instructions:
Hints:
Create an understanding of parameters and assemblies.
Deliverables
Deliverables for Lab 3 will be a script that will import an existing pulley, change its parameters, and constrain it in an assembly. This parametric pulley file is provided for you to use for this lab. Download it and put it in the same folder as your python script.
Instructions:
- Create a part (design) in Fusion 360 (not in code) which consists of a single cylinder with a diameter of 0.5 cm and a length of your choosing.
- Create a function that imports the supplied part file as a new component into the design you created earlier. The function should return the occurrence of the gear you just imported.
- Create a function that will change some of the parameters in the pulley. The parameters in the part file that you will need to change are called “teethNum” and “shaftDiameter”. Your function should accept two parameters, one int and one float, to be assigned to those two parameters respectively.
- Create a function that will make an assembly constraint (joint) to attach the imported pulley to the cylinder you made earlier.
Hints:
- The face for the center hole is the only face of the only hole feature in the part.
- The proxy for the face can be obtained by using holeFace.createForAssemblyContext(thePulleyOccurenceYouImported)