PADT 0.042 - SketchUp "BIMmy" Dynamic Components - Part 02
Using Variations to Control Multiple Parameters
Controlling Multiple Parameters
Now that we have created a Component with a Parameter called “Variations”, it’s now time to see how Multiple Parameters can be controlled by just selecting a Variation. This saves a great deal of work instead of entering or selecting a series of Parameters.
If we open the Component we saved last time (or create a 1x1x1 component named “Box01”), select the Component (remember???) and then open the Component Options and Component Attribute Menus. Then on the Component Attributes Menus we select the plus (“+”) icon next to “Add attribute” you’ll see the list of possible Attributes to add.
When you hover your cursor over one of the Attributes, a brief description appears above. We’re only going to explore a few of them here. First off is “Position.” This controls the absolute Position in 3-Space by entering values for X, Y, and Z. It should be noted that we created our Component with the Origin at 0,0,0 — the Parameter value will set the Position of the Component based on the Origin of Component. This is a change in the Absolute Position and not a Move by those values. I will always create these types of Components with an Origin of 0,0,0 just to be sure.
Let’s going ahead and add the X Position Attribute.
It should be showing a value of 0. Now this is where the SketchUp fun starts. Click into this Field and enter the text:
and then hit Tab. You should notice that nothing has changed. This is because SketchUp is showing the “result” of the Function you just created. To see the Function, hit the “Toggle Formula View” icon in the upper-right corner. You will Toggle back and forth frequently to make sure the Value of the Parameters are being assigned correctly.
What the “choose” function does is based on the Variable entered, in this case “Variations”, the Value of X will be assigned to the next values which are separated by the commas. By selecting the Values we’ve assigned to “Variations”, the cube will move along the X-Axis. To see this working, go to the Component Options in the “Variations” pull-down, select “Variations02” and hit “Apply”. The cube will Move to Position 1,0,0 in 3-space. If you selection “Variations03”, the cube will Move to 2,0,0.
We can now go back into the Component Attributes and add the Y and Z Position Parameters and enter the same “choose” function into each one (Copy/Paste will work). Remember to Hit Tab after you’ve entered the Function. SketchUp has a way to enter a Parameter name into the currently active Field by selecting it. This can be a pain if you forget about that and it will enter other Parameters into the Field you may not want. Now if you select any of the Variations, the cube Component will Move in all 3 of the Axes.
Under “Add attribute” there are Gray Bars above each set of Parameters where you can “add all”.
The next Parameters we want to select let us select the Size or Length of the Component. These are the “LenX”, “LenY”, and “LenZ” Parameters. This will set the Absolute Size of Component no matter what size the Component are originally created to be. In other words, this is not a Scaling Parameter, but one which sets the Length along that particular axis. So if we’ve created a Component which is 14 units in the X axis and then use “LenX” assigned to 6, the Component will be Scaled down to 6 units in the X axis. Based on how the Component is created, Scaling may not be what we want so other considerations will be necessary.
Let’s go ahead and add all the Size Parameters and for each one enter the Functions:
LenX =choose(Variations,1,2,3) LenY =choose(Variations,.5,1,2) LenZ =choose(Variations,1,3,6)
As you can see, you can set the Parameters to any values you wish and even use decimals.
A Length “Gotcha”
If you wanted to Mirror a Component, you might think you’d simply enter a Negative value for the Parameter. Unfortunately, this doesn’t work. SketchUp will let you enter the value, but it ignores the Minus Sign. This does cause a bunch of extra work when a simple negative Length would work. Sigh…
SketchUp lacks “primitives” such as Sweeps, Tori (Toruses???), Extrusions, which can be controlled by Parameters. What we do instead to create these BIMmy type Components is using Building Blocks which are set to single units. This makes them easier to size and they don’t get all deformed when setting the Lengths in each axis. We will see in future installments how to use these simple forms with just a few tricks to get the BIMmy Components which you need.
You can see that by having Multiple Parameters under a single option makes life much easier and more consistent. In the future, we’ll see the next several Parameters which can be added, how easy it is to Add additional Variations and lead up to the creation of a complex BIMmy Component.
Lots more to cover, but I didn’t want to make these too long. Let me know if you have any comments or questions. I hope you can see where this is going and sparked your own thoughts on how you might apply these to your work or at least give you a different way of approaching things.
Announcement & Tutorials Links
Editors Comment: Some of the best "hidden" features
Double Click - Skill Builder - SketchUp
Dave Edwards has been in the CAD/BIM industry as a manager, developer, consultant, speaker, and author for almost 40 years. He has had 80 magazine articles published, written 3 international newsletters, reviewed over 300 CAD/BIM applications and 3D modeled over 1 Billion dollars worth of architectural projects. He is available for professional alpha/beta testing, application feature consulting, technical documentation, seminar presentations, and voice overs.
Copyright © 2021 by Dave Edwards Consulting. All rights reserved.
All trademarks belong to their respective holders.
Translations and opinions expressed are not necessarily shared by Dave Edwards Consulting.
By accessing this newsletter in any manner, you agree to settle disputes within ten days of publication date by arbitration within the city limits of Montgomery, Alabama, United States with the arbitrator selected by an agent acting on behalf of Dave Edwards Consulting.