Author Topic: Edit this Reactor Lisp. Is it possible?  (Read 4041 times)

0 Members and 1 Guest are viewing this topic.

titoprax

  • Mosquito
  • Posts: 14
Edit this Reactor Lisp. Is it possible?
« on: February 16, 2012, 04:38:31 AM »



Can anyone help me realize this?
With permission of Lee-Mac this List (http://www.lee-mac.com/autolabelattributes.html) offers a great help, giving us the possibility of knowing automatically, by attributes, the total number of a block (A). This value is an attribute.
Could have one text that would give us the highest value of the attribute of the block (A)?

I would like something



New text I can move?

Thanks for giving me permission Lee Mac
Sorry for my bad English
« Last Edit: February 17, 2012, 10:54:36 AM by CAB »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this List. Is it possible?
« Reply #1 on: February 16, 2012, 07:23:12 AM »
Could you do that with a FIELD and simply count the total number of 'A' blocks?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this List. Is it possible?
« Reply #2 on: February 16, 2012, 09:34:34 AM »
No is possible.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this List. Is it possible?
« Reply #3 on: February 16, 2012, 05:51:02 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this List. Is it possible?
« Reply #4 on: February 17, 2012, 03:25:31 AM »
My opinion, this list is best and I only seek to add this modification to the List

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this List. Is it possible?
« Reply #5 on: February 17, 2012, 08:50:50 AM »
A text or attribute for total number of a particular block can be updated with technique's in this lisp:
http://www.theswamp.org/index.php?topic=40880.msg461743#msg461743
Although it is only dealing with erased objects it can be made to count added objects as well.
Adding this sub and modifying the main lisp.
Code: [Select]
(defun _ObjAdded (a b / nent)
  (if (and *CommandFlag* (= InsertName TargetName))
    (progn
      ;;  increment a variable for the insert count
    )
  )
)

What I am giving you are the bones of the routine and much work is needed to complete it.

There are other reactor that may work too.

The premise here is that the start command reactor clears a counter variable and it is updated by the
ADD and ERASE reactors. Then the command END reactor would update the TEXT with a new value.
Not addressed or explored here are the OOPS and UNDO commands.

Another option is to simple count the INSERTS each time a command is used but filter for commands
that would modify the database like COPY PASTE ERASE INSERT OOPS & UNDO.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this Reactor Lisp. Is it possible?
« Reply #6 on: February 17, 2012, 10:58:45 AM »
OK I modified Lee's routine to update a Block attribute with the total block count.
Find this in the code and update with your names.
Code: [Select]
(setq *blockname* "MyBlockName"  ;; Name of Block to be Updated
      *blocktag*  "MyTagName"    ;; Attribute Tag to be Updated
)

(setq *blocktotalname* "MyTotalsBlock"   ; CAB 02/17/2012
      *totalstag*      "MyTotalsTag"
)

Note you may need to REGEN to see the updates.
« Last Edit: February 17, 2012, 11:02:15 AM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this Reactor Lisp. Is it possible?
« Reply #7 on: February 19, 2012, 02:15:27 PM »
it is possible only update a single block?
I have applied the list with several blocks and does not work

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this Reactor Lisp. Is it possible?
« Reply #8 on: February 19, 2012, 04:32:38 PM »
Please post your test drawing and I'll take a look.

You did do a REGEN to see any updates to the drawing?
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this Reactor Lisp. Is it possible?
« Reply #9 on: February 19, 2012, 04:41:10 PM »
Here's an example.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this Reactor Lisp. Is it possible?
« Reply #10 on: February 20, 2012, 01:02:46 PM »
OK the routine will handle one block name only. To use more you will need to modify teh routine.
The one I posted works with this drawing.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this Reactor Lisp. Is it possible?
« Reply #11 on: February 20, 2012, 01:26:05 PM »
there is only one .dwg

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Edit this Reactor Lisp. Is it possible?
« Reply #12 on: February 20, 2012, 02:03:23 PM »
Yes the routine here http://www.theswamp.org/index.php?topic=40953.msg461871#msg461871
Will update the drawing I posted with the block count when adding or deleting the INSERT named "MyBlockName".
The Insert named "MyTotalsBlock" will be updated with the count.
A REGEN is needed to display the change.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this Reactor Lisp. Is it possible?
« Reply #13 on: February 20, 2012, 02:32:09 PM »
I attempt to modify the routine I used with more blocks in the dwg. I have not succeeded.

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this Reactor Lisp. Is it possible?
« Reply #14 on: February 21, 2012, 02:16:39 AM »
I've tried with more than two blocks. I modified the routine for each block. But just last routine is updated when loading. Why?

titoprax

  • Mosquito
  • Posts: 14
Re: Edit this Reactor Lisp. Is it possible?
« Reply #15 on: March 03, 2012, 06:17:33 PM »
please, someone could help me?