AutoCAD tutorial: Creating a dynamic block 1.0

Learn step by step how to create a dynamic block.
Català - Castellano
Dynamic blocks are a very important resource to increase productivity. What would require several different blocks can be achieved with a single dynamic one if we know how to give the right editing properties to them.
In this first tutorial we will create a dynamic block for an escalator. The block will be able to be stretched to have different step widths, overall lengths (to cover different floor to floor heights) and some other cool properties.
First of all we have to create a standard block. I got the escalator DWG from Schindler, the block is good enough for the precise height you request it. This is the drawing we will start with.
We will name this block Dynamic Escalator. To make this block a dynamic block we have to add Parameters and Actions to the block. To do so, select the blog and type BE (Block Editor). Inside the Block Editor you will find a series of buttons that will allow you to do that.

We have to plan what we want to do, and probably you will have to do things twice or trice till you make the block work as you want. To start we will set the parameters and actions that will let us modify the step width of the escalator. This are the steps we will follow.
  • Click the parameter button
  • Select Linear as Parameter Type.
  • Select the two edges of one of the steps.
  • Choose to show only one grip.
This is how the parameter should look after we created it.

Now, we need to add an action to this parameter. This are the steps to follow.
  • Click the Action Button
  • Select the Parameter
  • Choose Stretch As the Action Type
  • Select the Grip
  • Select the stretch Polygon (like you would select the objects using the STRETCH command)
  • Select the objects to be stretched.
The block should resemble to this:
Try to save and go out of the block editor. Check that the block behaves the way it is expected. If it does we will continue adding parameters and actions.
Next we will make the block stretchable in length. This will require more than one action since we not only want to stretch the lines, but also make extra steps appear when we stretch the block.
We will do the following:
  • Add a linear parameter to the length of the block
  • Add a stretch action to stretch all the lateral lines of the escalator.
  • Add an Array action to make new steps when the block is edited.
The first think we will have to do is to erase all the step lines except one so we can use the array action properly. With that done, we add a linear parameter to the length of the block. See that I also added some markers on a non plot layer so I know certain points where the length of the escalator corresponds to certain floor to floor height (like 5m, 6m, 7m etc.). The block should look something like this at this point (inside the Block Editor Interface):

We want the step lines to show all the way from end to end of the escalator. We need to add an array action to the same linear parameter that we are using for stretching the block in length. We follow these process:
  • Click the action Button
  • Select the linear parameter.
  • Choose Array as the action
  • Select the single step line we have when prompted to select objects
It is important that the linear parameter starts on the step line and ends where the steps are supposed to disappear, otherwise you might get step lines out of the boundaries they are supposed to be. Again, save the block and go out of the block editor interface. Check that the parameters and actions added work as desired.
We still want to add a couple more parameters to the block. First we want text and an arrow that shows if the escalator is going down or arriving from the level below. We will use the text DN for going down, and AR for an escalator that arrives to the level we are showing. First we prepare the block for the actions we want to add.
  • We type both texts AR and DN on the same exact position.
  • We mirror the arrow head so we have a line with arrows on both sides.
It should look like the image above. What we want to do is to be able to use the same block either for an elevator going down (DN text with the arrow pointing away form the text) and an elevator arriving to the level we are showing (AR text with the arrow pointing to it). We will have to use a different parameter type called Visibility. It is important to know the buttons related to the visibility parameter. They are situated on the upper right corner of the block editor interface. They are the following.

  1. Toggles objects on other visibility states on and off.
  2. Makes an object visible in the current visibility state
  3. Hides an object form the current visibility state
  4. Calls the visibility states dialog box (where we will create different visibility states)
So the steps we will follow are:
  • first we have to do is click button #4 and create a new visibility state called AR, and rename the existing one as DN.
  • Having DN as active visibility state select the AR text and the arrowhead pointing to it and click button #3 to hide them. (the objects will diappear if you didn't click button #1, if you did the objects will be faded)
  • Turn AR visibility state active, select DN text and arrowhead pointing away from it and hide them (button #3)
Let's check if it worked. Save the block and get out of the BE interface. Select the block and click on the grip corresponding to the visibility parameter. You'll be able to select the visibility mode you want so with the same block you will be able to show both an escalator going down and another arriving to the level we are. See the too pictures below.

The last edit I added to the block is a rotation aprameter and action that allows me to rotate the text to any position I want. The idea is that no matter in which angle the escalator is placed, the text should always be facing the right way. See the image below to understand what I mean..
I am not going to detail the steps for this since it is pretty simple and similar to the rest of the process. Just think of using a rotation parameter and action applied to the center of the text.
If you want to check the escalator file, you can download it here.

Show me more...

SketchUp Plugins: Weld

A must have Plugin for SketchUp. Weld lines to hide edges and clean geometry.
Català - Castellano - Deutsch
One of my favorite plugins for SketchUp is the Weld plugin. What this plugin does is basically, as its name says, to weld lines together. This might read very basic, but it becomes very important in many situations. Let´s see some examples.
The basic use is to join lines together. So if we have a bunch of lines and we want to transform them into a sort of polyline, we can do that selecting the lines and going to Plugins - Weld. I personally have a shrtcut for Weld that is the letter W, since I use it very very often.
The plugin has also another use that is to create faces from a bunch of interconnected lines. Once we select to run the plugin, it will as as two questions.
- Close Curve?
- Find faces for this curve?
If we select yes in the first questions, SketchUp automatically draws a line to close the curve. A yes to the second one will create a face if possible.
The third use is to hide edges for extruded objects. When we extrude a face, all the corners become edges. Something like this:But in this case we don't want to see the edges on the curved surface. We could select those edges and hide them, or better we can weld the lines that create that curved surface before we extrude the face:
By selecting the lines and welding them together we will get a new object with only 4 vertical edges, instead of having all those shown in the first image.
If you want to download the plugin click here.

Update: The same that I had done here with the weld plugin to extrude the curved face without seeing the intermediate edges, can be achieved without the weld plugin by using the Soften Edges Tool from SketchUp. Both process are equally quick, the results are almost the same.

Show me more...