To
giangnamqb91: Bạn chịu khó đọc bài này.
[size=36]Rotating a Revit model family in 3 different axes, by reference lines
[/size]
In this article, I would like to provide an example of how to control the rotation of a Revit family in 3 different axes.
In this illustration, borrowed from a Wikipedia article, there is a point at the sphere, marked as “star”; the location of that point on the sphere is given by two angles: the azimuth, at the horizontal plane, and the altitude, at the vertical plane. I have drawn a red arrow over the image, from the center of the sphere to the star. That arrow is similar to the object that I am going to use in this example. |
[size]
In this exercise, the arrow object should be able to rotate in 3 different ways by parameters, in this order:
[/size]
- The arrow should rotate along its own axis.
- The arrow should rotate on the xz plane, or altitude.
- The arrow should rotate on the xy plane, or azimuth.
[size]
What we need?
We need a series of families, at least 4; in this example I use 5 in total, like this:
[/size]
- Family 1 = This is the base object that we want to rotate. In this exercise, I use an object that looks like an arrow.
- Family 2 = This is an utility family that has 2 tasks: rotate Family 1 along its own axis, and carry on parameters from Family 1 to Family 3.
- Family 3 = This is an utility family with 2 tasks : rotate Family 2 on the xz plane, and carry on parameters from Family 2 to Family 4.
- Family 4 = This is an utility family with 2 tasks : rotate Family 3 on the xy plane, and carry on parameters from family 3 to the final host.
- Family 5 = (optional) This can be the final host, or the family where you are assembling Family 4 with other elements.
[size]
All these families have something in common:
[/size]
- All the families were created with the generic model template (but they could belong to other categories).
- In the Family Category and Parameters, “work-plane based” has been set to On, and “always vertical” has been set to Off. These settings are essential to achieving the rotations.
[size]
Family 1
Family 1 is the object that I want to rotate. For this exercise, I have modeled an arrow, 1 meter long (1000 mm), with a secondary small arrow, perpendicular to the main arrow, as shown in this image. The small arrow is just for us to be able to notice the rotation along the own axis of the arrow family. The only parameter of this family is the length, just as an example of a parameter that can be carried over from Family 1 to Family 5, if necessary.
The image shown on the right shows the front view of Family 1. It is a pair of solids by the revolve method.
Parameters created in this family: “length” : [instance/length/dimensions]
Parameters that are tied here from a previous family: none.
Parameters that will pass to the next family: “length”
[/size]
[size]
Family 2
In family 2, we want to provide a method for rotating Family 1 along its own axis. To do this, first we go to the right view of Family 2, and create a reference line at the intersection of the origin reference planes. Then we align and lock the start point of this reference line to the horizontal and vertical reference planes. Then, we provide an angular dimension to control the rotation of the line, and we convert this dimension into a parameter to control this rotation, such as “rot_own_axis”. Then, we set back this angle to zero.
Now we switch to the floor plan view of Family 2, switch windows to Family 1, and load Family 1 into Family 2; choosing “Place on work plane”, we place Family 1 with its origin at the intersection of the origin reference planes of Family 2.
Then, select the nested Family 1, from the ribbon select “Edit work plane”, then “pick a plane”, then, select the reference line.
[/size]
Parameters created in this family: | “rot_own_axis” : [instance/angle/dimensions], “length” [instance/length/dimensions] |
Parameters that are tied here from a previous family: | “length” |
Parameters that will pass to the next family: | “rot_own_axis”, “length” |
[size]
Family 3
In Family 3, we want to provide a method for rotating Family 2 on the xz plane, or altitude. To do this, first we go to the front view of Family 3, and create a reference line at the intersection of the origin reference planes. Then we align and lock the start point of this reference line to the horizontal and vertical reference planes. Then, we provide an angular dimension to control the rotation of the line, and we make a parameter to control this rotation, such as “rot_xz_altitude”. Then, we set back this angle to zero.
Now we switch to the floor plan view of Family 3, switch windows to Family 2, and load Family 2 into Family 3; choosing “Place on work plane”, we place Family 2 with its origin at the intersection of the origin reference planes of Family 3.
Then, select the nested Family 2, from the ribbon select “Edit work plane”, then “pick a plane”, then, select the reference line.
[/size]
Parameters created in this family: | “rot_own_axis” : [instance/angle/dimensions], “rot_xz_altitude” : [instance/angle/dimensions] “length” [instance/length/dimensions] |
Parameters that are tied here from a previous family: | “rot_own_axis” |
Parameters that will pass to the next family: | “rot_own_axis”, “rot_xz_altitude”, “length” |
[size]
Family 4
In family 4, we want to provide a method for rotating Family 3 on the xy plane, or azimuth. To do this, first we go to the plan view of Family 4, and create a reference line at the intersection of the origin reference planes. Then we align and lock the start point of this reference line to the horizontal and vertical reference planes. Then, we provide an angular dimension to control the rotation of the line, and we convert the dimension into a parameter to control this rotation, such as “rot_xy_azimuth”. Then, we set back this angle to zero.
Now we switch windows to Family 3, and load Family 3 into Family 4; choosing “Place on work plane”, we place Family 2 with its origin at the intersection of the origin reference planes of Family 3.
Then, select the nested Family 3, from the ribbon select “Edit work plane”, then “pick a plane”, then, select the reference line.
[/size]
Parameters created in this family: | “rot_own_axis” [instance/angle/dimensions], “rot_xy_azimuth” : [instance/angle/dimensions], “rot_xz_altitude” : [instance/angle/dimensions] “length” [instance/length/dimensions] |
Parameters that are tied here from a previous family: | “rot_own_axis”, “rot_xz_altitude”, “length” |
Parameters that will pass to the next family: | “rot_own_axis”, “rot_xz_altitude”, rot_xz_azimuth”, “length” |
[size]
Family 5
(optional)
The three rotations are already done. This 5th family is just the final host where the family that rotates by three axes can be assembled with other elements.
From the plan view of Family 5, we switch windows to Family 4, and load Family 4 into Family 5; place at at a face or at a work-plane, as necessary.
Other than tying parameters from the previous family, no more work is required in this family.
[/size]
Parameters created in this family: | “rot_own_axis” [instance/angle/dimensions], “rot_xy_azimuth” : [instance/angle/dimensions], “rot_xz_altitude” : [instance/angle/dimensions] “length” [instance/length/dimensions] |
Parameters that are tied here from a previous family: | “rot_own_axis”, “rot_xz_altitude”, “rot_xy_azimuth”, “length” |
Parameters that will pass to the next family: | none |
[size]
Rotating the family in a project
From Family 5, we load into a project. For this example, I placed a sphere mass in a project, of 1 meter of radius (1000 mm), and then, placed an instance of this arrow family at the center of the sphere. Then, I placed some additional model lines inside the sphere, to show the main axis of each plane. The following pictures show different values for the three rotating parameters.
[/size]