• AutoCAD

Create and test dynamic blocks

Create and edit a dynamic block using the Block Authoring palette, and then test the block.


Tutorial resources

These downloadable resources will be used to complete this tutorial:


00:04

The creation of dynamic blocks is a procedure that

00:07

takes a few steps and involves different elements.

00:11

If block elements are already defined as blocks,

00:14

you can edit them in the block editor to begin adding parameters and actions to them,

00:20

which will essentially turn them into dynamic blocks.

00:23

These elements are located in the

00:25

block authoring palette which we'll cover shortly

00:29

to get started with creating a dynamic block.

00:32

It's a good idea to have a strategy for what you want the block to do.

00:36

For example, if we look at these dynamic blocks,

00:41

do you want it to have

00:43

multiple view options?

00:45

Like in this example,

00:47

we can change to a different view

00:50

and even flip the block

00:54

and then change back to the original view

00:57

or

00:58

do you want it to be able to

01:01

flip

01:03

such as this section arrow

01:06

or do you want to do something like rotate

01:09

and rotate to specific angles?

01:13

These are all examples of what dynamic blocks can do

01:18

for these examples. In this lesson,

01:22

I'm gonna start off with objects that have already been turned into blocks

01:27

and then I'll turn them into dynamic blocks

01:32

for the first one,

01:33

I'll take a title, call out block

01:36

and add the functionality

01:38

to be able to lengthen the line on it.

01:41

The first thing to do

01:42

is to bring it into the block editor

01:45

and then add a linear parameter to it.

01:49

So this block has attributes.

01:51

So to bring it into the block editor, I'm going to select

01:56

it right click and choose block editor

01:60

once in the block editor.

02:02

Like I said, I'm going to add a linear parameter to it.

02:08

We'll go ahead and

02:12

add it.

02:14

I'm gonna use the nearest O

02:16

snap right about here. I don't have to add it to the entire line.

02:21

Then I'm gonna bring it over to the endpoint

02:24

and stretch above to place this where I can see it. So this is

02:30

a linear parameter.

02:33

Next, we're gonna add a stretch action to it

02:37

by coming to the actions, tab

02:40

clicking on stretch

02:42

and notice when I add this, it asks me to select the parameter.

02:47

So I'm gonna select the parameter

02:50

and then when it asks for a point, I want to use the endpoint of this line.

02:57

It then asks for the first corner of stretch frame.

02:60

So we're going to essentially draw a

03:02

rectangle

03:06

around the end point.

03:09

Then it asks to select objects. I'm going to grab this attribute

03:14

and this line,

03:15

you might be asking why am I grabbing the attribute?

03:19

We want this attribute to move with the line when the action is

03:25

completed.

03:27

So just like that I've added

03:31

a parameter and an action.

03:34

But there's a couple of housekeeping things I like to point out number one,

03:38

I'm gonna go into the properties

03:41

of the parameter

03:44

by selecting it

03:46

right, clicking and going to properties.

03:49

Then what I wanna do

03:51

is

03:52

I can change the name of the parameter and I can also put a

03:58

description which is gonna be important,

04:02

change this name to stretch.

04:06

And then for the description,

04:08

I'm gonna type in

04:10

length and line because this is what's gonna show

04:13

up when we hover over the grip for this.

04:18

So just like that, I'll close the properties parameter.

04:22

Now, when we feel we're

04:24

OK with our block instead of getting out of the

04:28

block and then finding out maybe something doesn't work properly.

04:32

What you wanna do is come over here to the test block function.

04:36

This brings you into the test block area

04:40

and allows you to

04:42

literally test the block out.

04:45

So notice the first thing I want to do is click

04:47

on the block to show the grip that was added.

04:50

And when I hover over that grip, it gives me the description that I entered earlier.

04:56

This is important that way your users know what this functionality is gonna bring.

05:01

So when I lengthen the line,

05:03

you can see that it works

05:06

beautifully.

05:08

It takes the attribute with it

05:12

and it still keeps the anchor point of the line

05:17

and does everything that we wanted it to do.

05:20

So at this point, I can click close test block

05:24

and then my block is ready.

05:27

So I'll be able to click the close block editor.

05:31

And this is important. We wanna save the changes

05:36

to the dynamic block.

Video transcript

00:04

The creation of dynamic blocks is a procedure that

00:07

takes a few steps and involves different elements.

00:11

If block elements are already defined as blocks,

00:14

you can edit them in the block editor to begin adding parameters and actions to them,

00:20

which will essentially turn them into dynamic blocks.

00:23

These elements are located in the

00:25

block authoring palette which we'll cover shortly

00:29

to get started with creating a dynamic block.

00:32

It's a good idea to have a strategy for what you want the block to do.

00:36

For example, if we look at these dynamic blocks,

00:41

do you want it to have

00:43

multiple view options?

00:45

Like in this example,

00:47

we can change to a different view

00:50

and even flip the block

00:54

and then change back to the original view

00:57

or

00:58

do you want it to be able to

01:01

flip

01:03

such as this section arrow

01:06

or do you want to do something like rotate

01:09

and rotate to specific angles?

01:13

These are all examples of what dynamic blocks can do

01:18

for these examples. In this lesson,

01:22

I'm gonna start off with objects that have already been turned into blocks

01:27

and then I'll turn them into dynamic blocks

01:32

for the first one,

01:33

I'll take a title, call out block

01:36

and add the functionality

01:38

to be able to lengthen the line on it.

01:41

The first thing to do

01:42

is to bring it into the block editor

01:45

and then add a linear parameter to it.

01:49

So this block has attributes.

01:51

So to bring it into the block editor, I'm going to select

01:56

it right click and choose block editor

01:60

once in the block editor.

02:02

Like I said, I'm going to add a linear parameter to it.

02:08

We'll go ahead and

02:12

add it.

02:14

I'm gonna use the nearest O

02:16

snap right about here. I don't have to add it to the entire line.

02:21

Then I'm gonna bring it over to the endpoint

02:24

and stretch above to place this where I can see it. So this is

02:30

a linear parameter.

02:33

Next, we're gonna add a stretch action to it

02:37

by coming to the actions, tab

02:40

clicking on stretch

02:42

and notice when I add this, it asks me to select the parameter.

02:47

So I'm gonna select the parameter

02:50

and then when it asks for a point, I want to use the endpoint of this line.

02:57

It then asks for the first corner of stretch frame.

02:60

So we're going to essentially draw a

03:02

rectangle

03:06

around the end point.

03:09

Then it asks to select objects. I'm going to grab this attribute

03:14

and this line,

03:15

you might be asking why am I grabbing the attribute?

03:19

We want this attribute to move with the line when the action is

03:25

completed.

03:27

So just like that I've added

03:31

a parameter and an action.

03:34

But there's a couple of housekeeping things I like to point out number one,

03:38

I'm gonna go into the properties

03:41

of the parameter

03:44

by selecting it

03:46

right, clicking and going to properties.

03:49

Then what I wanna do

03:51

is

03:52

I can change the name of the parameter and I can also put a

03:58

description which is gonna be important,

04:02

change this name to stretch.

04:06

And then for the description,

04:08

I'm gonna type in

04:10

length and line because this is what's gonna show

04:13

up when we hover over the grip for this.

04:18

So just like that, I'll close the properties parameter.

04:22

Now, when we feel we're

04:24

OK with our block instead of getting out of the

04:28

block and then finding out maybe something doesn't work properly.

04:32

What you wanna do is come over here to the test block function.

04:36

This brings you into the test block area

04:40

and allows you to

04:42

literally test the block out.

04:45

So notice the first thing I want to do is click

04:47

on the block to show the grip that was added.

04:50

And when I hover over that grip, it gives me the description that I entered earlier.

04:56

This is important that way your users know what this functionality is gonna bring.

05:01

So when I lengthen the line,

05:03

you can see that it works

05:06

beautifully.

05:08

It takes the attribute with it

05:12

and it still keeps the anchor point of the line

05:17

and does everything that we wanted it to do.

05:20

So at this point, I can click close test block

05:24

and then my block is ready.

05:27

So I'll be able to click the close block editor.

05:31

And this is important. We wanna save the changes

05:36

to the dynamic block.

Was this information helpful?