Author Topic: Area reactor  (Read 33937 times)

0 Members and 1 Guest are viewing this topic.

MvdP

  • Guest
Area reactor
« on: May 23, 2006, 11:46:43 AM »
I am searching for a area reactor that will let you pick a boundary (closed polyline)
and inserts a block with attributes for sq.meters and the purpose of this selected area.Is there one around here on this forum which is working this way.?

Crank

  • Water Moccasin
  • Posts: 1503
Re: Area reactor
« Reply #1 on: May 23, 2006, 01:03:34 PM »
Try fields. Then you can use standard Autocad.

If you don't have 2005+ you can do a search on this forum.
Vault Professional 2023     +     AEC Collection

MvdP

  • Guest
Re: Area reactor
« Reply #2 on: May 23, 2006, 01:14:25 PM »
I did search and i found several reactors, but to me it seems that they are not completely working.Or am i missing one.

Crank

  • Water Moccasin
  • Posts: 1503
Re: Area reactor
« Reply #3 on: May 23, 2006, 02:07:27 PM »
http://www.theswamp.org/index.php?topic=9573.0
http://www.theswamp.org/index.php?topic=7308.0
http://www.theswamp.org/index.php?topic=6559.0
http://www.theswamp.org/index.php?topic=8710.0

But fields are so easy to use:
  • Place the block with the attribute
  • _.eattedit    >    rightclick on value   >   Insert Field...
  • Field category = Objects
  • Field names: = Object
  • Object type > Pick (select your polyline)
  • Property = Area , Format (make a selection from the list)
  • You can also change the Field Format if you like (or add a prefix/suffix)
  • In the enhanced Attribute Editor select OK

If you stretch the polyline the attribute will change. It doesn't show inmedially though: It depents on the value of FIELDEVAL how often fields update, but you can always use the command UPDATEFIELD
Quote
FIELDEVAL:
0 Not updated
1 Updated on open
2 Updated on save
4 Updated on plot
8 Updated on use of ETRANSMIT
16 Updated on regeneration

31 All options
Vault Professional 2023     +     AEC Collection

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: Area reactor
« Reply #4 on: May 23, 2006, 04:20:07 PM »
I don't think you can write sq. meters in fields...
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

Crank

  • Water Moccasin
  • Posts: 1503
Re: Area reactor
« Reply #5 on: May 24, 2006, 12:49:06 AM »
I don't think you can write sq. meters in fields...
If your drawing is in mm then you can convert mm2 to m2 in the `Field format`-dialog:
 
Vault Professional 2023     +     AEC Collection

Crank

  • Water Moccasin
  • Posts: 1503
Re: Area reactor
« Reply #6 on: May 24, 2006, 01:37:06 AM »
I don't have much time right now, but it's easy to make something in lisp without a reactor.
First you need to compose the field format. That can be done with the FIELD-command (see picture)

A lisp file looks something like this (not tested):
Code: [Select]
;================================================
; AreaDemo using fields 24-05-2006 by J.J.Damstra
; http://www.theswamp.org/index.php?topic=10248.0
;================================================

(defun c:AreaDemo (/ ce entity oba fieldstring)
  (vl-load-com)

  (setq ce (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)

  (setq entity (car (entsel "\nSelect a closed polyline: ")))
  (setq oba (vla-get-objectid (vlax-ename->vla-object entity)))

;Use the FIELD-command to compose the next line: 
;%<\AcObjProp.16.2 Object(%<\_ObjId 2130265440>%).Area \f "%lu2%ps[,m2]%ds44%ct8[1e-006]">%
  (setq fieldstring (strcat "%<\\AcObjProp Object(%<\\_ObjId "
                      (rtos oba 2 0)
                      ">%).Area \f "%lu2%ps[,m2]%ds44%ct8[1e-006]">%"))

; (RE)PLACE THE STRING IN YOUR DRAWING HERE

  (setvar "CMDECHO" ce)
  (princ)
)
Vault Professional 2023     +     AEC Collection

MvdP

  • Guest
Re: Area reactor
« Reply #7 on: May 24, 2006, 02:04:34 AM »
Maybe this can be turned into a challenge and make an area reactor that looks like this one.!!!!!

http://www.atablex.com/toolkit-help/labelroom.htm

Jürg Menzi

  • Swamp Rat
  • Posts: 599
  • Oberegg, Switzerland
Re: Area reactor
« Reply #8 on: May 24, 2006, 02:11:33 AM »
If your drawing is in mm then you can convert mm2 to m2 in the `Field format`-dialog:

Ahhh, didn't recognize that... but this option is only available with A2k6+, not with A2k5.
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k16... A2k24 - Start R2.18

MvdP

  • Guest
Re: Area reactor
« Reply #9 on: May 31, 2006, 11:34:09 AM »
I checked all of the above and found out that this one

http://www.theswamp.org/index.php?topic=8710.0

is  the best working rector (written by T.willey) but ,i my wish for this reactor is the following.

- That it will insert a block (with att.) on a picked place and let the routine insert the values in this block.(This routine was also available but not working correctly and gave me errors.)
- And in the same block an areaname att. (f.i. kitchen, bathroom) input via dcl and  this may too  come in handy  a range of radio buttons for choosing feet or mm and maybe precision.

Bob Wahr

  • Guest
Re: Area reactor
« Reply #10 on: May 31, 2006, 11:43:55 AM »
***bites tongue







hard***

MvdP

  • Guest
Re: Area reactor
« Reply #11 on: May 31, 2006, 12:05:10 PM »
$10 , One License Code

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Area reactor
« Reply #12 on: May 31, 2006, 01:13:01 PM »
I checked all of the above and found out that this one

http://www.theswamp.org/index.php?topic=8710.0

is  the best working rector (written by T.willey) but ,i my wish for this reactor is the following.

- That it will insert a block (with att.) on a picked place and let the routine insert the values in this block.(This routine was also available but not working correctly and gave me errors.)
- And in the same block an areaname att. (f.i. kitchen, bathroom) input via dcl and  this may too  come in handy  a range of radio buttons for choosing feet or mm and maybe precision.


If I have some time, then I will look into making it work with text or attributes.  I don't know how hard that will be, since I had a lot of help from Luis to write that one.
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

MvdP

  • Guest
Re: Area reactor
« Reply #13 on: May 31, 2006, 01:34:24 PM »
Quote

If I have some time, then I will look into making it work with text or attributes.  I don't know how hard that will be, since I had a lot of help from Luis to write that one.


Thanks Tim that would be highly appreciated.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Area reactor
« Reply #14 on: May 31, 2006, 01:50:34 PM »
It won't be in any form difficult at all, I do not write or use routines with reactors anymore, I would prefer nowdays that if it is one available and cheap, to buy it.  :-)
To true Luis.  I'm just using it as a learning thing.  I don't have a use form them in my day to day cad life, but it is fun to learn.

Here is the updated main routine.
Code: [Select]
(defun c:AreaReact (/ Sel EntData PolyObj TextObj ReactList Pos TextSel)

;|  Adds a presistant reactor to a polyline object that
    updates a selected text object to the polylines area
    in square feet.  You will have to have the subs loaded
    in everydrawing for it to work, so that it know what
    to do with the reactor, because it is saved with the
    drawing.  Saves the association between the text
    and the polyline in the extension dictionary of the
    polyline.  If the text object is deleted, then the
    program will remove the reactor related to the polyline.
    Thanks to Luis Esquivel for his help and guidance.
    v1.0 2/2006 Tim Willey
    v1.1 5/2006 Added the ability to select an attribute.
|;

(if
 (and
  (setq Sel (entsel "\n Select polyline to get area of: "))
  (setq EntData (entget (car Sel)))
  (= (cdr (assoc 0 EntData)) "LWPOLYLINE")
  (setq PolyObj (vlax-ename->vla-object (car Sel)))
  (setq Sel (nentsel "\n Select text of hold area value: "))
  (setq EntData (entget (car Sel)))
  (or
   (if (vl-position (cdr (assoc 0 EntData)) '("TEXT" "MTEXT"))
    (setq TextSel T)
   )
   (= (cdr (assoc 0 EntData))  "ATTRIB")
  )
  (if TextSel
   (if (equal (length Sel) 2)
    T
    (prompt "\n Cannot select nested text.")
   )
   T
  )
  (setq TextObj (vlax-ename->vla-object (car Sel)))
 )
 (progn
  (PutArea PolyObj TextObj)
  (if
   (and
    (setq ReactList (AssociatedReactors PolyObj))
    (setq Pos (vl-position "MyAreaReactorModified" (mapcar 'vlr-data ReactList)))
   )
   (vlr-remove (nth Pos ReactList))
  )
  (vlr-pers
   (vlr-object-reactor
    (list PolyObj)
    "MyAreaReactorModified"
    '(
     (:vlr-modified . MakeCmdEndReactor)
     (:vlr-erased . ObjectEraseReactor)
;     (:vlr-unerased . ObjectUnErasedReactor)
    )
   )
  )
 )
)
(princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.