Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Attribute inheritance from different block

dc
Participant

Attribute inheritance from different block

dc
Participant
Participant

Hi folks,

 

I am looking for a method to inherit attributes from one block to another, perhaps using fields, and using plain vanilla AutoCAD 2016.

 

One block is the "Device" block and carries a "device name" attribute

 

A second block is placed inside this block (not nested) and also has an attribute named "Device Name". It needs to match the name of the Device Block that it is located within.

 

Multiple of the second blocks are placed inside the Device block.

 

We would like to automate the "Device name" attribute of the second block so that it inherits the name of the Device block.

 

Can anyone think of a way to do this? Would this require lisp or C progrmming, or could it be done within the application?
Thanks in advance for your thoughts.

0 Me gusta
Responder
Soluciones aceptadas (1)
1.422 Vistas
5 Respuestas
Respuestas (5)

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

>> A second block is placed inside this block (not nested)

As I don't understand this - on one side one block "inside the other", but not nested (?) - can you upload a drawing with 2 or three samples with attributes filled manually like you want to have?

 

- alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
0 Me gusta

Ajilal.Vijayan
Advisor
Advisor
Solución aceptada

Hi dc,

Welcome to Autodesk Community.

 

By using fields you can achieve this.

While inserting/After inserting the second block right click inside the Value box of attribute value to select 'Insert filed'

  1. Select Object from Filed category
  2. Select Object from Field names
  3. Click the Block reference button from Object type and select the First block.
  4. Then select the attribute tag from Property filed
  5. Click ok to inherit the first block attribute value to second block.
  6. Multiple instance of second block can be made by simply making copies.

Click the +sign to see the image and please find the attached drawing also.

Spoiler
FIELD.JPG

 

0 Me gusta

dc
Participant
Participant
I think Vigayan got close to the idea. I will give this a try. this could speed things up, but it is not 100% automation as I would hope. The idea is to avoid having to manually edit the second block instances to match the first, and to update if you moved it from one "host" block to another. to do that we would probably need to do some programming? at any rate the method you suggested could reduce a lot of double entry. question, will ATTOUT reeturn the result of the field reference, not the field name? Thanks for the help, I will give it a try and let you know my thoughts.
0 Me gusta

dc
Participant
Participant

Thank you Vijayan!

 

I tried your solution and it works well. I am now learning much more about fields and of course want to push the automation as far as I can.

Now within your example, is it possible to make a field that acquires a value from another block attribute, based on the location of the blocks insertion point relative to a boundary of the "host" block? Please see attached dwg file illustrating this.

 

These drawings will all be 2d. There will never be an overlap between one "host" and another.

 

Wondering if this could be accomplished with a Diesel expression inside the field?

0 Me gusta

ross.mclee
Contributor
Contributor

Did anything come of this query? I would love to be able to do this.

I.e. move a block from one position to another (from within the boundary of one 'host' block into another 'host'), and its atributes automatically take on the values of the new host. E.G Move a table from the kitchen to the lounge and the table blocks attribute <host room> changes from kitchen to lounge.

 

Anyone?....

TIA

0 Me gusta