Jump to content

Dynamic Blocks & Attributes


Laurel

Recommended Posts

Hi

 

I've created a dynamic block with two visibility states. The second state is a copy of the first state, but some of the attribute definitions have been moved, along with some of the geometry.

 

When I insert the block, then toggle between the two visibility states, the geometry changes as I would expect, but the attributes stay in the position dictated on the first state.

 

How can I make sure that the attributes move for the second state, as I need them to.

 

Thanks.

Link to comment
Share on other sites

  • Replies 38
  • Created
  • Last Reply

Top Posters In This Topic

  • Laurel

    10

  • Magnum Z

    10

  • dbroada

    6

  • razorangel

    5

I think you will have to duplicate the attributes and define their individual visibility state. You create custom fields and refernece the attribute to the field if you only wqnt the attribute value stored once.

 

Alternatively you could put in a move action to move the attribute but I think you will have to reference that to a distance.

Link to comment
Share on other sites

Hi

 

Thanks for the reply.

 

I've already duplicated the attributes, and defined their individual visibility states. The block editor shows each visibility state as I would expect it to display when I insert the block, but this isn't how it is actually shown.

 

I could use a move action, but am not sure that this is ideal. Would I be able to make the move action work automatically when the visibility action is performed, without extra input from the operator?

 

I thought of creating another attribute definition on the second visibility state that displays the contents of a particular attribute on the first visibility state. Is this possible? If so, how?

Link to comment
Share on other sites

I tried a block with a couple of attributes and the visibility state worked as expected. I assumed you wanted a single instance of each attribute.

Link to comment
Share on other sites

Can you post the block you are working on so we could take a look at it. I think I have an idea but want to check it out.

It sounds like the perameters on the 1st visiblity state are broken going onto the second. From what I understand is when you stretch the block the attributes stay put. If the attributes need to move with the block they can be included in the 1st visibility states actions if you hit the thaw all states button (white and orange boxes on the top right) and select the attributes in the action.

Link to comment
Share on other sites

Can you post the block you are working on so we could take a look at it.

 

Of course, here it is.

http://homepage.ntlworld.com/pjhardwick/Autocad/Title_Block.dwg

 

As (I hope) you will be able to see, the dynamic block I am concerned with is a Title Block for my drawings. Selection of the Visibility parameter (1/4 of the way up on the left) toggles between portrait or landscape versions of the block, but the attributes are not moving to the positions indicated in the block editor.

Link to comment
Share on other sites

Of course, here it is.

http://homepage.ntlworld.com/pjhardwick/Autocad/Title_Block.dwg

 

As (I hope) you will be able to see, the dynamic block I am concerned with is a Title Block for my drawings. Selection of the Visibility parameter (1/4 of the way up on the left) toggles between portrait or landscape versions of the block, but the attributes are not moving to the positions indicated in the block editor.

Hey there.

 

I took a look. There wasn't a block, but if I were going to try what you are going to accomplish, I might try a rotation action with a max angle of 90 degrees in incrememts of 90 degree angles only rotating what you want rotated. Of course, that is only if I understand what it is you want to accomplish.

Link to comment
Share on other sites

Thanks for looking Barry.

 

The file is a saved block. Try inserting it as a block into a drawing. The file is ok, I've double checked. :)

 

All I want to be able to do is have two visibility states where the attributes move depending on the state I choose.

 

For reasons which escape me, this doesn't seem to be happening in the block I have designed.

Link to comment
Share on other sites

Ok, I've been playing with my dynamic block, and basically rewritten it.

 

When I created the first example (the one you can download above) I knew I wanted to duplicate the attributes on the first visibility state, to be shown in the second state. To achieve this, I made duplicates of the original attributes and moved them to their new locations. I think this might be my problem.

 

By doing this, I have effectively created two attributes with the same Tag. The Block Attribute Manager (battman) seems to confirm this by displaying the new attribute definition in red. This changes to black if I change the offending Tag.

 

OK, I've worked out what I am doing wrong, but still don't know how to put it right.

 

I want to be able to insert a block, adding the values for the attributes as I am prompted. All these values are present on the first visibility state. How can I duplicate the contents of these attributes to be shown in a different field on the second state?

 

I realise that a move parameter might do the job, but having seen this problem thru' this far, I'd really like to know if I can do it with a visibility parameter, especially as what I am trying to achieve seems so simple at first.

 

Also, in a related matter, please see my other post on a related matter that I still have not figured out. (http://www.cadtutor.net/forum/showthread.php?p=68439#post68439)

 

Thanks all for your help.

Link to comment
Share on other sites

The file is a saved block. Try inserting it as a block into a drawing.

I was going to say that! :D

 

Laurel, I had to convert it to 2004 format but it works as you want here. I renamed your duplicate tags though. I think you have confused it by having 2 attributes with the same name. Rename one set and try again.

 

This is where you can use fields and custom properties although it would mean inputting your details using the drawing properties box rather than attedit.

Link to comment
Share on other sites

Thanks DB

 

That does work, thanks very much, but I have a further problem.

 

When you insert the block, try changing the values from the defaults, then change to the other visibility state. You should see that the attributes to not show the changes you have made, but show the defaults instead.

 

I want to be able to enter values for the attributes on the first visibility state, and those values to be shown on the second state.

 

This also relates to the other post I mentioned, where attributes only on the second state are not prompted for values when inserting the block.

 

Any suggestions for either of these problems? (And thanks for your help!!)

Link to comment
Share on other sites

This is what I was trying to say. I'm not at my desk today but try this...

 

For one pair of attributes (at block definition level) give a default of (you may have to search these forums). Give it document title as a default. DO NOT OVERTYPE THIS WHEN INSERTING BLOCK!!!!

 

Now go to Drawing Properties (on File menu I think) and type the number you want in there. Do a regen and all should be clear.

Link to comment
Share on other sites

Laurel,

As I sid yesterday, I'm on a training course ATM so can't really do a lot but give this a try. (I had to save in 2004 format). Note that you need to go to the Drawing Properties to change the Title & Name - DON'T USE the normal dialogue box, you will break the link.

Link to comment
Share on other sites

Dave,

 

Thanks very much for your help - very appreciated, especially if you are busy.

 

Anyway, I've tried as you suggest, and even tried your version of my block, but things don't seem to have changed - The attributes just don't want to move when I switch between states.

 

The use of drawing properties is a good idea though, and one I will adopt when I get to to bottom of this problem.

 

Any more suggestions? (At you leisure, when you are not at training :) )

Link to comment
Share on other sites

training on InTools - a giant database for oil & gas type installations. We are having a bit of a break to sort out some "undocumented features".

 

I must admit to not having checked the block I made. Can you check that I renamed one set of attributes please. Again, keep the default as I set them.

Link to comment
Share on other sites

OK Dave, apologies time.

 

The method you suggest DOES work, although the editted block doesn't - You forgot to rename the Tags.

 

Whilst (for this example) using the drawing properties works for the title, and probably for other data given a bit of creative writing in the Drawing Properties fields, it doesn't resolve the problem of being unable to effectively move an attribute by using the visibility parameter. For certain data it is far more desirable to input it when inserting the block, rather than relying on it being automatically obtained from elsewhere.

 

At the moment I am able to input values for attributes in the first visibility state, but for whatever reason, I am not being asked for values of the attributes in the second state.

 

Is there a way to enter values (when prompted upon inserting a block) for attributes in the first visibility state, and display these values in completely seperate textboxes on the second state? (Like inserting a field on an attribute?) That would probably resolve matters.

Link to comment
Share on other sites

Worked it out!!! :D

 

1) Create a new dynamic block

2) Add an attribute (with a default value)

3) Create a visibility parameter

4) Create a new visibility state

5) Make the visibility parameter visible to the first state, invisible to the second

6) Define an attribute on the second visibility state:

6.1) Place the attribute away from the first attribute

6.2) The attribute should NOT be in verify mode

6.3) Give it a unique tag

6.4) In the value field, select

6.5) Select Field Category > Object

6.6) Select Field Names > Object

6.7) Click on

6.8 )Select the first attribute (created in step 2)

6.9) Select Property > Value

6.10) Select OK

 

When you insert the block into the drawing, you will be prompted to input the value for the first attribute on the first visibility state. Do so, changing it from the default value. When you change the block to the second visibility state, the first attribute will disappear, and the second will appear elsewhere, but it will not be up to date - it will show the default value of the first attribute, not the updated value as you want.

 

Simply REGEN the drawing and the value in the second attribute will reflect that in the first!

 

It took some time to work it out, but boy what a sense of satisfaction when you get there.

 

Thanks to all who helped, especially Dave.

Link to comment
Share on other sites

  • 1 year later...

That's what I was looking for. It works !

Only one single promt for two attributs, visible one time in each visibility state on different position.

Thanks guys. :D

Link to comment
Share on other sites

Rather late, but what were you trying to do again?

 

 

Two visibility states with two different sets of attributes?

...or...

Two visibility states with the same/similar set of attributes in two different locations?

 

I looked at the block and just wanted to clarify because if it's the second question there's a much more simple answer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...