Creating a block with a self-referencing field

Creating a block with a self-referencing field

braedeny
Participant Participant
1,076 Views
9 Replies
Message 1 of 10

Creating a block with a self-referencing field

braedeny
Participant
Participant

I want to create a dynamic block that automatically displays information about itself. In particular I'd like it to list the name of the layer it's on, the (color, linetype, lineweight, transparency) of the layer it's on, it's own (color, linetype, lineweight, transparency), and possibly other information about it's own properties.

 

The goal is to show a list/table where each line on the list is this Dynamic Block set to a different layer. The list will then display the layer information for all the necessary layers as they are currently set. When it appears within a viewport it will list the settings for those layers in the current viewport layer state.

 

0 Likes
Accepted solutions (1)
1,077 Views
9 Replies
Replies (9)
Message 2 of 10

h_s_walker
Mentor
Mentor

The only problem I have is not knowing how to stop the dialog box from popping, because you need to use Attributes.

See the attached drawing.

 

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 3 of 10

pendean
Community Legend
Community Legend
@h_s_walker ATTDIA set to 0 perhaps? maybe?
0 Likes
Message 4 of 10

h_s_walker
Mentor
Mentor

Nope. Just tried it. The dialog box still pops up

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 5 of 10

braedeny
Participant
Participant

The upper group of text is a set of Multiline text boxes, each with a plain text for a label followed by a field (object type) referencing a line with all of it's properties set to "BYBLOCK".  It looks like you're trying to make it reference and display the properties of the layer, but no matter what I change things to, it always just says "Layer 0" and "BYBLOCK" for all of the other fields.

 

The lower group of text is a set of block attributes. Each block attribute is set to have default text including a field of the BlockPlaceholder type. It looks like this actually does a good job of displaying the properties attributed to the block itself (but not those assigned to it when it's properties are set to "BYLAYER"). Unfortunately I can't seem to replicate that behavior. When I do the same setup the fields always return the values of "TrueColor", "LINETYPE", "Lineweight", & "ENTITYTRANSPARENCY".

 

I'll post my file so you can see what I'm working with.

0 Likes
Message 6 of 10

braedeny
Participant
Participant

Here is my DWG file, the blocks I'm working with are called "Layer Key" and "Line Property Key".

 

"Layer Key" is supposed to name the layer that it is on, show a line on that layer with all properties set to 'BYLAYER', and list the specific property values of the current layer over top of that line.

"Line Property Key" is just supposed show a line with all it's properties set to 'BYBLOCK', and list the properties set to the block itself (regardless of layer) over top of the line.

 

I'm fairly sure everything is entirely possible in AutoCAD, the example provided by hwalker proves that at the very least "Line Property Key" is.

0 Likes
Message 7 of 10

h_s_walker
Mentor
Mentor

The first set of info was just referencing the line "INSIDE" the block to show you that when you change the details "OUTSIDE" the block the bottom ones change to what you have done. After a regen of course.

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 8 of 10

h_s_walker
Mentor
Mentor
Accepted solution

@braedeny You need to be using the items highlighted and ringed in red in the image below (the box needs to be ticked). 

Also the attributes cannot be constant otherwise they will not change. That's the problem I was having, if you double click on my block you will see the dialog box pop up.

Capture.JPG

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes
Message 9 of 10

braedeny
Participant
Participant

Okay, I've got something.

 

Originally I wanted a table of dynamic blocks where the rows represented certain selected layers and the columns represented certain layer states. The first column's block would display the current properties of the layer that the block was currently on, and the blocks in other columns would show set properties that would not change by layer.

 

The Blocks I've made here can show the properties of the blocks themselves, but I don't have the column to show the properties of the current layer state. But that still allows me to make MOST of the table I need.

 

Take a look at what I've got - (see attachment) - It's a printable layer organizer that shows what a line on each layer is intended to look like in each layer state. It can help to identify inconsistencies and keep drawings looking consistent when copying and moving details between files with layers that are set up similarly, but maybe not exactly the same.

0 Likes
Message 10 of 10

h_s_walker
Mentor
Mentor

The only thing I can suggest is do a screen grab of the layers and then add that to your drawing

Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Left Handed and Proud

0 Likes