Jump to content

Single attribute repeated multiple times


Lawrst

Recommended Posts

I have been looking around but still can't find an answer to this.

 

I want to create a block, for electrical schematics, simply that has a bunch of page and line references. The lines will be set, the pages will be the variable.

 

I want to be able to type 01 or 99 into an attribute and have that reflected to all of the page references within the block.

Using a field within the block won't update when I change the attribute.

 

The only way I have found to do something similar is a field that is looking at a lines length. Then just using an increment linear dimension this varies the length of the line.

I dont mind this but the issue I can't solve with it is the 1-9

I want 01,02,03,04 not 1,2,3,4 etc.

 

Is anyone able to help me with either of these?

 

I hope I make sense and I have placed this in the right place.

Link to comment
Share on other sites

If you can type in the value, you can use an object reference within the other attributes that references the attribute you actually filled in.

I've attached a graphic scale block I did that allows me to edit the attribute that displays the scale value, and the other attributes in the block reference the first attribute, and just add a scale factor to change the value.

 

The trick is to create the attribute block, create all the reference fields by editing the attributes, then create a block out of that block to use for inserting. When the block is inserted, just explode and all values will be filled in.

scale_small_EXPLODE.dwg

Link to comment
Share on other sites

I understand what you've done, but it becomes quite cumbersome when I have 90 or so attributes.

 

Does anyone have any other ideas?

 

Is there a way to force a field to display 2 characters regardless? 01 02 etc. When given a value of 1 or 2?

Link to comment
Share on other sites

Did not understand your question actually. You need to able to set the page number?

Using a field within the block won't update when I change the attribute.

Link to comment
Share on other sites

So if for example within the block editor if i used a field in the default value of Att2 to reference the value of Att1 (both attributes are contained within the same block) It will only ever update with the default value of Att1.

 

 

So instead of a text format to edit all of the page numbers I have used a linear dimension with a stretched line. The page number references (the top line of the bubble) have fields that references this line.

 

Unfortunate this has resulted in the field returning a value of 1 instead of 01 as required by our drawing standards.

Link to comment
Share on other sites

Just throwing this out there as a generality.

 

Sometimes it is easier to change the standard than it is to make the program meet the standard.

Link to comment
Share on other sites

There may be a way of formatting text the old fashioned way like me to old 123.456 ###.# = 123.4, so 1 maybe ## = 01. Using lisp not a problem but you have LT. Steve-g you watching ? A diesel function to check

Link to comment
Share on other sites

Not sure about Diesel, but you can use a trick to get multiple attributes to show the same value, the second (and following) attributes use a field for the value, you pick an object for the field and select the first attribute and from the properties select value, make sure the box "display value for block reference" is ticked.

field.jpg

If you add attributes to an existing block you will need to use the attsync command before the block updates.

You have to include a dynamic parameter, it doesn't matter which one, so long as a dynamic action is performed on the block when it has been inserted (you only need do this once but it has to be done for the trick to work) and once you have a working block you can copy it as often as you like and they all work.

It takes a lot of explaining but try the attached file the 3 blocks work (when alter the Attribute "count" and do a regen, but insert a new block and it won't work untill after you alter the visibility state just one time)

It would be cumbersome to have to go through this process for your 99 lines, luckily when you have created the second attribute with the working field you can copy it within the block editor and paste as much as you want (though it would be a good idea to edit each one to have a unique TAG, as Autocad can do strange things when TAG's aren't unique (quickest way is select an attribute and change the TAG value in the properties palette).

Schematic Template (1).dwg

Link to comment
Share on other sites

Thats not a bad solution, didnt know that existed.

Thanks.

 

I guess the issue i have with it is doesn't achieve much more than creating a field external to the block editor with the attributes to do the same thing (this just saves some time with not needing to redo the fields constantly).

 

It doesnt seem to work for text unfortunately, that would have been the real solution.

Link to comment
Share on other sites

If you edit the field there is a chance that you can break the block.

Try this, select one of the blocks, and alter the value in the properties palette.

1.jpg

And then run the regenall command

2.jpg

If you change the value of an attribute by editing then that overwrites the field.

Link to comment
Share on other sites

The issue there is I still have 90 or so Attributes in the end with fields. This is what I was hoping to avoid.

 

The way I have it is an easier solution to understand but i do appreciate the efforts.

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...