Increment Automatically Added Attributes

Increment Automatically Added Attributes

jilko6XKHK
Explorer Explorer
986 Views
6 Replies
Message 1 of 7

Increment Automatically Added Attributes

jilko6XKHK
Explorer
Explorer

Hello all! I'm creating a block that adds an array of similar attributes to a table as it is stretched. Each time the attributes are copied, they come in with the same tag (Company, Address, Contact, etc.). Is there a way to make the attributes automatically increment as they are added into the block? As I drag out the table, I'd like it to create Company1, Company2, Company3, etc. as attributes instead of having numerous, undifferentiated "Company" fields to edit all at once.

My current solution is to make the attributes list a separate block nested within the table block. The idea would be to adjust (stretch) the table to include as many entries as needed, then explode the block to get access to the attributes list block in each cell. The problem with this, though, is that I don't like exploding anything and we lose the stretch adjustment capabilities once it is exploded.

Any advice is appreciated. Thanks in advance!

0 Likes
Accepted solutions (1)
987 Views
6 Replies
Replies (6)
Message 2 of 7

Libbya
Mentor
Mentor

Post your block.

 

Is there a functional limit to the number of lines?  I would assume so as paper size is not typically limitless.  With a functional limit, you could have a visibility state for each additional attribute and switch visibility states using a double lookup that references your linear parameter to create a faux array.

Message 3 of 7

jilko6XKHK
Explorer
Explorer

I am fairly new to dynamic block creation, so if you see anything that could be done better, I'm open to corrections! I hadn't thought about using a limit, but I guess that isn't a bad idea. I have yet to work with the lookup parameter/action, so I haven't been sure what that might be used for.

0 Likes
Message 4 of 7

Libbya
Mentor
Mentor

The way you have that block set up seems entirely nonfunctional.  You will be unable to access the attribute values for the arrayed blocks.

 

What is a reasonable upper limit for the number of rows?

 

The best approach I know of for you block is as I described in my last post.  Make a new visibility state for each added row.  Use a double lookup referencing the Distance2 parameter value to switch to the appropriate visibility state. 

0 Likes
Message 5 of 7

jilko6XKHK
Explorer
Explorer

Yea, that's why my only solution to this setup so far is to explode the outer block to access the nested attributes. I've figured out the lookup parameter a little bit, but I'm slightly confused on the double lookup. Does this mean I can drag the Distance2 state and it'll do the same functions as a lookup dropdown? So far I have it so the lookup is a dropdown and the block will show the states and resize itself, but I don't know how to control that with the drag grip.

0 Likes
Message 6 of 7

Libbya
Mentor
Mentor
Accepted solution

Double lookups are special.  See how to make one in this thread:

https://forums.autodesk.com/t5/dynamic-blocks-forum/how-to-make-a-double-lookup/m-p/5785708

 

They allow two table to be linked to a single lookup parameter.  The following is a very abbreviated description of how they work.  You can use one table as an 'input' table and include the Distance2 parameter and values.  You can then use the second table as an 'output' table and add the visibility parameter and states.  The row names (or 'lookup values') need to match between the two tables, and if they do, then when the block state matches a row on the first table, the parameter(s) on the second table are switched to match that row. 

 

In the past, I have posted a considerable amount of information in various threads on this forum detailing how the double lookups work.  All of that is accessible using the search function.   

Message 7 of 7

jilko6XKHK
Explorer
Explorer

That worked very well, thank you!