Code Red > VB(A)

object events

(1/3) > >>

daron:
Okay peeps, I need to create a little vba function. What this should do is cause a piece of text to change when I modify another piece of text. Here's what I have:

--- Code: ---Seating            Capacity                  Units
TWO'S (30X30)      reactor#               usermod#
--- End code ---

several times over. Somehow, the user would also have to supply a number to multiply the usermod# to so the reactor would know what to do. Just had a thought: the reactor# in each individual case would always reference the same multiple, example above # of usermod# x 2 (being two seats per table) would equal reactor#. Therefore, I suppose we could attach the multiple into the code of the event for reactor#? As I write, it begins to feel more complicated.
All I know to do is this:


--- Code: ---Private Sub AcadDocument_ObjectModified(ByVal Object As Object)

End Sub
--- End code ---


I don't know where to begin. Please help?

SpeedCAD:
Hi...

Is more easy from Visual Lisp. But from VBA also it can do. You must add to entity a XDATA and from VBA read these XDATA and update other entity.

I don't give you an example beacuse I don't understand fine.

Meybe you put an image example for I understand it.

daron:
I'm not sure what an image will do. All I want to do is have a piece of text that's looking at another piece of text, then when the text changes that this particular text is looking at, it multiplies. ex. 0 0. The first 0 might have a value related to it like 4. Say there are four seat to a given table. The second 0 is user-changed to 6. Now instead of 0 tables, I have 6 tables. The first 0 knows to multiply its value of 4 by the number that was changed by the user to six, thus changing itself to 24. End result: 0 0 becomes 24 6. I know it will take some upfront work, but I can take care of that with a template and there will only be numbers ever given in these areas, so I'm not too concerned about alpha characters, though I can imagine some instances that could cause a problem. Any help appreciated. Thanks.

Keith™:
The data MUST be well defined and several things must be taken care to make sure you do not create problems in the future for yourself.
I would expect that a block with attributes might be the best alternative, at least then a user cannot delete the wrong thing and cause the program to go wacko...

Let me work on a 3 column table with attributes and a reactor to make it effective. If that is acceptable...

daron:
That would be great Keith, but let's work on plain text objects if you don't mind. I'm aware that there are problems with this, but you know how the unknowledgeable can be with that dreaded explode command, but then I suppose we could counter that in this too, couldn't we? hehehe.

Navigation

[0] Message Index

[#] Next page

Go to full version