Explicity defining array actions and editing elements

Explicity defining array actions and editing elements

Anonymous
Not applicable
857 Views
5 Replies
Message 1 of 6

Explicity defining array actions and editing elements

Anonymous
Not applicable

Hello,

I'm in the process of teaching myself how to work with dynamic blocks, with the eventual goal of creating varying instances of them using lisp routines. I'm pretty new, so bear with me if this is a lot simpler than I'm making it...

 

I have a simple dynamic block with 2 array actions defined and working how I want them to. Now i'm wondering if and/or where it is possible to change the size of the arrays explicitly (not just by dragging the handle), and edit individual elements of the array. Eventually, I'd like to do all this with lisp, but for now I just want to do it within AutoCAD so i can get a grasp on WHAT exactly I need to manipulate when I write the lisp program.

 

I've attached the file I'm working on to this post. The very end goal of this exercise is to end up with a lisp routine that creates an instance of "block" (as it's temporarily called in the file), ask the user (or a reference csv/txt file) how big it should be (# of lines - you'll see what I mean in the file), and change the values of the arrayed text items to values that will be pulled off of a csv file.

 

Obviously I have a long way to go, and as I said I'm learning, so I do not expect anyone to build this for me, just take a look at what I have and kind of point me in the right direction for my next steps.

 

Some specific questions:

1. Is what i'm trying to do possible?

2. Should I be arraying text objects and trying to explicity edit each one (it will be automated, not the users job), or should I be using attributes? I feel like I should actually be using attributes as that will make it easier for me to parse information from the completed project, but I can't seem to find out how, if it's even possible, to procedurally generate (array of attributes?) more attributes to match the number of lines being used.

3. Have I gone about this all wrong and should I blow it up and start over from a completely different way of going about it?

0 Likes
Accepted solutions (1)
858 Views
5 Replies
Replies (5)
Message 2 of 6

Libbya
Mentor
Mentor

1. Nope.

2.  You cannot edit individual arrayed objects.  All arrayed objects will be identical.  You can, in some ways, edit the source object that is arrayed and then all arrayed objects will change to the edited version.  If you want individual lines of text, you will not be able to use an array.

3.  Probably.  You could array the text boxes and size the rows of mtext or multiline attribute to match.  If the total number of text objects is limited you could use attributes and visibility states to display each new state progressively through the use of a double lookup.  All of that is a bit complicated.  When the end desired result is to drive it all with LISP, the ROI may not work out all that well.

0 Likes
Message 3 of 6

Anonymous
Not applicable

Thanks for the reply, I feared that would be the case. While there isn't necessarily a limit on the number of possible lines, I know from the context of how it will be used what a safe upper limit to put on it would be (around 50 lines). Would that be incredibly cumbersome to deal with that many lines using visibility states and lookups (both of which I'm not familiar with yet)?

 

Or, if I decide to use an mtext object and size it to the size of the array of boxes, is it at least possible to explicitly define the size of the array? I'd like to eventually remove the grip on the array and have it automatically come in at the correct size (not be user changeable).

0 Likes
Message 4 of 6

Libbya
Mentor
Mentor
Accepted solution

50 lines would be doable.  Attached is a version that works up to 5.  You would need to make the other 45 visibility states, create the additional 90 attributes and add the appropriate values to the lookup tables.  BACTIONBARMODE=0 to see both lookup tables.

 

You can set the size of the array using the Num10 property value.  1/8 unit per row.  You could also set the block up with a chained parameter if you needed the value to be 1 per row.  

 

 

Message 5 of 6

Anonymous
Not applicable

I know this is really old, but I just needed to revisit this thread real quick and noticed that I never thanked you. This was incredibly helpful, so thank you, Libbya!

0 Likes
Message 6 of 6

Libbya
Mentor
Mentor

You're welcome.  Glad to help.

0 Likes