Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Best way to keep blocks and Notes linked

6 REPLIES 6
Reply
Message 1 of 7
Redraiderr2009
1361 Views, 6 Replies

Best way to keep blocks and Notes linked

I have been racking my brain trying to figure out how to link the blocks quantities to a lables. Here is the senario. I have 5 tree blocks. I label them and the label contains the count of 5 in an attribute. That part works fine, but lets say I delete one. Now I have 4 blocks and 5 labeled. I am tring to figure the best possible way to link the blocks to a label so that it updates as I delete one. I have taken several approaches to this.

 

1. Just the way I explained it above and it is done with a lisp routine.

2. I have used fields to verify the plant counts. if one is deleted the quantity is updated or shows a #### in the area.

3. Now I am thinking a reactor might be the best way, but that seems like a lot of work to make a reactor. I haven't made one work consistantly yet.

 

Any ideas would be great.

 

Thanks,

 

6 REPLIES 6
Message 2 of 7
scot-65
in reply to: Redraiderr2009

Perhaps a poor-man's reactor?

 

Undefine the PLOT command (or QSAVE).

In it's place gather the counts that you have and update the values (table) before issuing .PLOT...

 

(My scenario involves the first occurrence of QSAVE to do file maintenance).

 

???


Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Message 3 of 7
Lee_Mac
in reply to: Redraiderr2009

This looked like a fun program to put together, so I challenged myself to see what I could come up with.

 

The result:

 

AutoLabel.gif

 

The attached program will automatically label a specific attribute in a set of blocks, renumbering when a block is inserted, copied or deleted. I plan to add the program and a full description to my website soon.

 

To set the program to work for your blocks, change the block name & attribute tag at the top of the source code:

 

(setq *blockname* "block"  ;; Name of Block to be Updated
      *blocktag*  "tag"    ;; Attribute Tag to be Updated
)

 

( These values are not case-sensitive )

There is no syntax for this program, it just needs to be loaded.

 


Message 4 of 7
Shneuph
in reply to: Lee_Mac

Thanks Lee, I look forward to figuring out how you handled reactor owner objects in this program.  I was trying to figure out a good way for another program I'm writing and got hung up. At first glance it looks like you've handled the UNDO issues with reactors too so I'll have to figure out how you did that as well.

---sig---------------------------------------
'(83 104 110 101 117 112 104 64 71 109 97 105 108 46 99 111 109)
Message 5 of 7
Lee_Mac
in reply to: Shneuph

Thanks Shneuph Smiley Happy  I'm sure there are a few more bugs to be ironed out, but I shall probably update the program further before I add it to my site. Of course, if you have any questions about the code, let me know.

Message 6 of 7
elderla
in reply to: Redraiderr2009

dear redraiderr:

I wonder if I could pick your brains a bit here:

I use AutoCAD LT 2012, which means I am limited by not being able to use lisp routines. I am trying to develop a note that will do something like what you are talking about . That is, I am labeling plants by counting them in groups, and then entering the count (and symbol) into a note as an attribute.  You mention you use fields for count. can you tell me how, precisely? Is there a way to get a field to return a count and plant block attribute  on a selection of more than one block?   I can't seem to find the correct options when I create fields in my note block.

 

I am not so worried about changes, I am willing to reselect if I change plants in one spot.

 

thanks so much for your help!

Donna

 

 

Message 7 of 7
elderla
in reply to: Redraiderr2009

dear redraiderr:

I wonder if I could pick your brains a bit here:

I use AutoCAD LT 2012, which means I am limited by not being able to use lisp routines. I am trying to develop a note that will do something like what you are talking about . That is, I am labeling plants by counting them in groups, and then entering the count (and symbol) into a note as an attribute.  You mention you use fields for count. can you tell me how, precisely? Is there a way to get a field to return a count and plant block attribute  on a selection of more than one block?   I can't seem to find the correct options when I create fields in my note block.

 

I am not so worried about changes, I am willing to reselect if I change plants in one spot.

 

thanks so much for your help!

Donna

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost