View Full Version : Area routine
eptownie1988
2007-07-11, 06:42 PM
Hello All:
I am looking for a way to find an area by selecting the inside of a room located on an architectural drawing. Is there a way to perform this without having to select individual points to define the room shape. Note the issue is the door openings. I am trying to determine the area of the room for placement of lights based on manufacturers criteria of room area and wall offsets. I have seen routines that work based on a closed polyline and wasn't sure if this was even possible using Auto LISP. Thanks in advance for any feedback.
Robert.Hall
2007-07-11, 10:33 PM
This routine might work if you close the door.
Doesn't need to be a polyline.
stephen.coff
2007-07-16, 02:42 PM
Does anyone have a routine like this one though will allow you to draw the the polyline rather have it try an hatch the area and then make the polyline from the hatch boarder ?
I suppose I want it closer to the area command in AutoCAD though I want it to place a polyline around the boarder and on a layer and then place the area as text in the middle.
I guess that probably confuses the hell out of every one ?
Something like this though this won't work and it's because of the " (command "pline") ". I hope this makes things a little clearer, see below:
(defun C:ZONES(/ plarea en myArea pt myNum )
(setvar "cmdecho" 1)
(princ "\n Starting Number is ")(princ (getvar "useri1"))
(princ ". To change this, reset the system variable USERI1")
(command "-layer" "m" "-M-AREA" "C" "20" "-M-AREA" "Lt" "DASHED2" "-M-AREA" "")
(setq plarea(command "_pline"))
(setq en(entlast))
(command "area" "Object" en)
(setq myArea(getvar "area"))
(setq pt(getpoint "\n SELECT LOCATION FOR TEXT : "))
(command "_style" "AREA" "arial" "500" "1" "0" "n" "n" )
(command "text" "style" "AREA" "Justify" "Center" Pt tht 0 myNum)
(command "text" "style" "AREA" "Justify" "Center" (polar Pt (* pi 1.5) (* tht 1.5)) tht 0 (strcat "AREA=" (rtos myArea)))
(setq myNum(getvar "useri1"))
(if(= myNum 0)(setq myNum 1))
(setvar "useri1" (+ myNum 1))
(setq myNum(itoa myNum))
(setvar "cmdecho" 1)
(princ)
)
Yes this is the "GA" routine picked to peices, sorry Jeffery.
Stephen
abdulhuck
2007-07-16, 03:28 PM
Hello All:
Note the issue is the door openings.
I want it to place a polyline around the boarder and on a layer and then place the area as text in the middle.
Friends,
Can you try the following?
Create a polyline shape (open or closed).
Issue MTEXT command.
Right click in the editor and choose "Insert field".
Under "field category" choose "Objects"
Under "Field names" choose "Object"
Pick the polyline using the pick button under "Object type"
Under "Property" choose "Area"
Choose required format under "Format"
Click "ok"
It is possible with open or close polylines. It will update the value when the area of the polyline is changed.
HTH,
Abdul Huck
Robert.Hall
2007-07-16, 08:24 PM
Nice. More than 1 way to skin a cat.
Fields are great. I wish the linked object
would highlight. I do not have a way to
verify the correct object was selected.
stephen.coff
2007-07-17, 02:12 AM
WOW,
Not what I was expecting though a good eye opener for me. I had no idea any of that was there.
Thank you abdulhuck
This is another way to do the job though not sure if it will give me the same result i am looking for. Will it give me the flexability like placing it on a layer and colure etc, hmmm ?
Can i do all of this with Lisp so it is automated ?
Stephen
krispy5
2007-07-17, 04:02 AM
If you look at the code for the field (in the field dialog down the bottom) you can insert this text with lisp (just have to get the objectID from the selected object). Field's can be inserted on any layer just like MText.
You could also retrieve the objectID from the field code and maybe use this to highlight the associated object?
stephen.coff
2007-07-21, 09:41 AM
Krispy5,
You are right, it shows the field expression down the bottom of the "Field" dialog box but how do I use it ?
I have selected the following:
Field Category: Object
Object Type: Polyline
Property: Area
Format: Decimal
Precision: 0
The Object ID was just a selected polyline drawn on the sheet.
Field Expresion: %<\AcObjProp Object(%<\_ObjId 2130650960>%).Area \f "%lu2%pr0">%
So that should be correct with the onl item to change being the Object ID. I just have know idea how to implement this data with lisp. Could anyone please assist me further with this ?
Stephen
Hi Stephen
Here is a quick example with area fields
Change area format as you need
(see commented lines)
(defun C:ARL (/ acsp adoc ent mtx obj)
(vl-load-com)
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object))))
(or acsp
(setq acsp (vla-get-modelspace
adoc)))
(while
(setq ent (entsel "\nSelect countour to label with area (Enter to exit): "))
(setq obj (vlax-ename->vla-object (car ent)))
(if (wcmatch (vla-get-objectname obj) "*Polyline")
(progn
(setq mtx (vlax-invoke acsp 'AddMText
(getpoint "\Pick pint to insert atttibute")
0
;; square ft., precison 2 decimals:
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%pr2%lu2%ct4%qf1\">%")
;; square ft., precison 0 decimals:
;;;(strcat "%<\\AcObjProp Object(%<\\_ObjId "
;;; (itoa (vlax-get obj 'ObjectID))
;;; ">%).Area \\f \"%pr0%lu2%ct4%qf1\">%")
;; metric with current precision:
;;;(strcat "%<\\AcObjProp Object(%<\\_ObjId "
;;; (itoa (vlax-get obj 'ObjectID))
;;; ">%).Area>%"
;;; )
;; metric with 2 decimals precision:
;;;(strcat "%<\\AcObjProp Object(%<\\_ObjId "
;;; (itoa (vlax-get obj 'ObjectID))
;;; ">%).Area \\f \"%lu2%pr2\>%"
;;; )
)
)
)
(alert "This is not a polyline")
)
)
(vla-regen adoc acallviewports)
(princ)
)
(princ "\nType ARL to label areas multiply")
(princ)
stephen.coff
2007-07-22, 07:36 AM
Fixo,
Thanks for that, I hope you don't mind I have changed it a little. I am yet to change it a little more eg: place it on a layer, colour.
I have tried it using the "metric with current precision:" and set the units to meters and precision to 0.0. though it still shows as millimeters and 0.000000.Obviously it isn't the units that alter it's state. How do I make it display in meters ?
See attached file.
Thanks
Stephen
Hi Stephen
Sorry for the late, was busy with
my own troubles
Here is edited version:
;;; Altered ARL.lsp by FIXO (AUGI) 22.07.07
(defun C:APLine (/ acsp adoc ent mtx obj)
(vl-load-com)
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object))))
(or acsp
(setq acsp (vla-get-modelspace
adoc)))
(while
(setq ent (entsel "\nSelect countour to label with area (Enter to exit): "))
(setq obj (vlax-ename->vla-object (car ent)))
(if (wcmatch (vla-get-objectname obj) "*Polyline")
(progn
(setq mtx (vlax-invoke acsp 'AddMText
(getpoint "\Pick point to insert text")
0
;; metric with precision 1 decimal w/o text:
;; where digit after "pr" in expression: \"%lu2%pr1\" is precision
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu2%pr1\">%"
)
;; metric with precision 1 decimal and text:
;;; (strcat "%<\\AcObjProp Object(%<\\_ObjId "
;;; (itoa (vlax-get obj 'ObjectID))
;;; ">%).Area \\f \"%lu2%pr1 sq. meters\">%"
;;; )
)
)
)
(alert "This is not a polyline")
)
)
(vla-regen adoc acallviewports)
(princ)
)
(princ "\nType APLine to label areas multiply")
(princ)
stephen.coff
2007-07-22, 11:34 AM
Fixo,
Sorry for pestering you. I worked out the decimal was the number after the pr. The thing I am lost with is how to convert the answer is in "millimeters" to "meters" (divide by 1000000).
Even with the units set to meters it makes no difference.
Stephen
stephen.coff
2007-07-22, 11:39 AM
Fixo,
Sorry I didn't notice the second part which has:
;; metric with precision 1 decimal and text:
;;; (strcat "%<\\AcObjProp Object(%<\\_ObjId "
;;; (itoa (vlax-get obj 'ObjectID))
;;; ">%).Area \\f \"%lu2%pr1 sq. meters\">%"
After altering the routine to look like:
;;; Altered ARL.lsp by FIXO (AUGI) 22.07.07
(defun C:ARL (/ acsp adoc ent mtx obj)
(vl-load-com)
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object))))
(or acsp
(setq acsp (vla-get-modelspace
adoc)))
(while
(setq ent (entsel "\nSelect countour to label with area (Enter to exit): "))
(setq obj (vlax-ename->vla-object (car ent)))
(if (wcmatch (vla-get-objectname obj) "*Polyline")
(progn
(setq mtx (vlax-invoke acsp 'AddMText
(getpoint "\Pick point to insert text")
0
;; metric with precision 1 decimal w/o text:
;; where digit after "pr" in expression: \"%lu2%pr1\" is precision
;;; (strcat "%<\\AcObjProp Object(%<\\_ObjId "
;;; (itoa (vlax-get obj 'ObjectID))
;;; ">%).Area \\f \"%lu2%pr1\">%"
)
;; metric with precision 1 decimal and text:
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu2%pr1 sq. meters\">%"
)
)
)
)
(alert "This is not a polyline")
)
)
(vla-regen adoc acallviewports)
(princ)
)
(princ "\nType APLine to label areas multiply")
(princ)
I thought that would fix it though it still places the text the same, in millimeters.
Stephen
Hi Stephen
Sorry I did not understand your task at the first time
because of my problem with English
You can remove spaces and "sq. meters" if this
no needed for you
Try this instead:
(defun C:APL (/ acsp adoc ent mtx obj)
(vl-load-com)
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object))))
(or acsp
(setq acsp (vla-get-modelspace
adoc)))
(if (/= (getvar "lunits") 2)
(progn
(alert "Set decimal units before\n you'll run this routine\nGo to Format->Units...")
(exit)(princ))
)
(while
(setq ent (entsel "\nSelect countour to label with area (Enter to exit): "))
(setq obj (vlax-ename->vla-object (car ent)))
(if (wcmatch (vla-get-objectname obj) "*Polyline")
(progn
(setq mtx (vlax-invoke acsp 'AddMText
(getpoint "\Pick point to insert text")
0
;; check for current units:
(cond ((= 4 (getvar "insunits"));<-- millimeters
;;metric (in sq. meters) with precision 1 decimals and text:
;; expression [1e-006] means to divide result on 1.000.000 to
;; convert sq.millimeters to sq. meters
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu6%qf1%ct8%pr1[1e-006] sq. meters\">%"
)
)
;;metric (in sq. millimeters) with precision 1 decimal and text:
((= 6 (getvar "insunits"));<-- meters
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu2%pr1\">%"
))
(T
;; current units w/o text:
(strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu6%qf1\">%"
)
)
)
)
)
)
(alert "This is not a polyline")
)
)
(vla-regen adoc acallviewports)
(princ)
)
(princ "\nType APL to label areas multiply")
(princ)
stephen.coff
2007-07-22, 01:49 PM
Fixo,
I have altered the routine a bit and sorry if this offends you as that's not the intension and am very grateful for your help. Below is the routine as it stands and I have changed the area to show in meters sq'd as per your last post. It is still showing as millimeters sq, I am not sure why. The area shown in a shaded window, can it be shown with out that, just plain text ?
I was going to post this as a different thread though maybe you can answer it easily ?
How do i get area routine to repeat multiple times without giving it a fixed number of times to repeat ?
I will have multiple areas drawn up in polylines and it would be good if I can select polyline after polyline. As I select the first one and then the location point for the text it will label it as "Zone 1" followed by the area. I can then select the next polyline and it will be lablled "Zone 2" followed by the area and so on. Is it possible to have the routine allow me to do this without using the repeat command and specifying how many polylines i will select ?
See Routine Below:
;;; Altered ARL.lsp by FIXO (AUGI) 22.07.07
(defun c:Atxt (/ ent adoc acsp obj mtx myNum)
(vl-load-com)
(if (= (getvar "USERI1") 0)
(setvar "USERI1" 1)
(progn
(setvar "USERI1" 1)
(alert "\n USERI1 Has Been Reset To: 1 ")
)
)
(command "-layer" "m" "-M-AREA" "C" "20"
"-M-AREA" "Lt" "DASHED2" "-M-AREA" "p"
"n" "-M-AREA" ""
)
(command "_style" "AREA" "arial" "500" "1" "0" "n" "n")
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(or acsp
(setq acsp (vla-get-modelspace
adoc
)
)
)
(while
(setq myNum (getvar "USERI1"))
(setq ent(entsel "\nSelect The Polyline You Wish To Calculate Area For: "))
(setq obj (vlax-ename->vla-object (car ent)))
(setq cpt (getpoint "\PICK LOCATION FOR AREA TEXT"))
(setq pt1 (mapcar '+ cpt (list 0 175 0)))
(setq pt2 (mapcar '+ cpt (list 0 -175 0)))
(setq txt1 (strcat "Zone " myNum))
(command "_text" "style" "area" "justify" "bc" pt1 "0" txt1)
;;: Displayed In Meters To 1 Decimal Place.
(setq txt2(strcat "%<\\AcObjProp Object (%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu6%qf1%ct8%pr1[1e-006]\">%"
)
)
(command "_text" "style" "area" "justify" "Tc" pt1 "0" txt2)
(vla-regen adoc acallviewports)
(setvar "USERI1" (+ myNum 1))
(setq myNum (itoa myNum))
)
(princ)
)
Stephen,
I have not have the time to help you,
I finished my work on today, because
I need now to work on my boss
I'll try to do it tomorrow
~'J'~
stephen.coff
2007-07-22, 03:00 PM
Fixo,
I am grateful for your help. I have played with the routine a bit and still can't get even your routine to display the area in meters sq'd, not sure why ?
Is there a way to have it display the info without the shaded grey around the area ?
I am not sure how you get the routine to keep on selecting polyline after polyline and wished I could get the altered version to do soas well. I understand that you are using the "while" function and "enter" is the trigger though can't get it to do the same.
I have posted another thread regarding the "while" command and expect some one will correct it. At which point, i am sure I will work out what i have done wrong.
Below is the routine at present:
(defun c:Atxt (/ ent adoc acsp obj mtx myNum)
(vl-load-com)
(if (= (getvar "USERI1") 0)
(setvar "USERI1" 1)
(progn
(setvar "USERI1" 1)
(alert "\n USERI1 Has Been Reset To: 1 ")
)
)
(setq oldunits (getvar "insunits"))
(command "-layer" "m" "-M-AREA" "C" "20"
"-M-AREA" "Lt" "DASHED2" "-M-AREA" "p"
"n" "-M-AREA" ""
)
(command "_style" "AREA" "arial" "500" "1" "0" "n" "n")
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(or acsp
(setq acsp (vla-get-modelspace
adoc
)
)
)
(while
(setq ent
(entsel
"\nSelect The Polyline You Wish To Calculate Area For (ENTER to exit): "
)
)
(setq obj (vlax-ename->vla-object (car ent)))
(if (wcmatch (vla-get-objectname obj) "*Polyline")
(progn
(setq myNum (getvar "USERI1"))
(setq cpt (getpoint "\PICK LOCATION FOR AREA TEXT"))
(setq pt1 (mapcar '+ cpt (list 0 175 0)))
(setq pt2 (mapcar '+ cpt (list 0 -175 0)))
(setq txt1 (strcat "Zone " myNum))
(command "_text" "style" "area" "justify" "bc" pt1 "0" txt1)
;;: Displayed In Meters To 1 Decimal Place.
(setq newunits (setvar "insunits" 4))
(setq
txt2 (strcat "%<\\AcObjProp Object (%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu6%qf1%ct8%pr1[1e-006]\">%"
)
)
(alert "THIS IS NOT A POLYLINE")
)
)
(command "_text" "style" "area" "justify" "Tc" pt1 "0" txt2)
(vla-regen adoc acallviewports)
(setvar "USERI1" (+ myNum 1))
(setq myNum (itoa myNum))
)
(setvar "insunits" oldunits)
(setvar "USERI1" 0)
(princ)
)
Thank you for your time and effort, much appreciated.
Stephen
Hi Stephen
You asked about the field background
Look at:
FIELDDISPLAY System Variable
Type: Integer
Saved in: Registry
Initial value: 1
Controls whether fields are displayed with a gray background. The background is not plotted.
0
Fields are displayed with no background
1
Fields are displayed with a gray background
Borrowed from Help
~'J'~
stephen.coff
2007-07-23, 01:41 AM
Thank you Fixo,
Fielddisplay it is.
Stephen
stephen.coff
2007-07-25, 10:31 AM
Well I have the issues i was having before pretty much sorted though the displaying of the area in meters squared. Can anyoneone assist further with that, at the moment it is displaying in millimeters squared.
Stephen
Hi Stephen
I so sorry, I have not have a time now
Try to remove square brakets from this
expression, change this
(setq
txt2 (strcat "%<\\AcObjProp Object (%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu6%qf1%ct8%pr1[1e-006]\">%"
)
)
on this one
(setq
txt2 (strcat "%<\\AcObjProp Object (%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu6%qf1%ct8%pr1\">%"
)
)
Not tested!
stephen.coff
2007-07-25, 12:57 PM
Fixo,
I understand and you have been such a great help, thank you.
I have tried removing the [1e-006] though no difference. I tried using the "cvunit" function though couldn't get it to work in this situation.
(setq txt2 (cvunit (strcat "%<\\AcObjProp Object (%<\\_ObjId " (itoa (vlax-get obj 'ObjectID)) " >%).Area \\f \"%lu6%qf1%ct8%pr1\">%") "mm" "km" ))
The area is pinting in squared millimeters and wish for it in squared meters. Does anyone else have any knowledge in this area that could assist ?
Stephen
Tom Beauford
2007-07-25, 02:11 PM
The area is pinting in squared millimeters and wish for it in squared meters. Does anyone else have any knowledge in this area that could assist ?
StephenYou really need to put more information in your user profile. What product you're using and the field you work in can make a big difference in the answers you need. Field evaluation has improved with each version of Autocad. The second expression is the first divided by 1000. Using Map 3D 2008 I simply clicked the Additional Formats... button and entered 0.001 as the Conversion Factor.%<\AcObjProp Object(%<\_ObjId 2127940096>%).Area>%
%<\AcObjProp.16.2 Object(%<\_ObjId 2127940096>%).Area \f "%ct8[0.001]">%
stephen.coff
2007-07-26, 01:26 AM
Tom,
Thnank you once again. Actually thats a funny thing you said that about my user profile, I am not sure how to edit it ? I am the CAD manager of a small drawing office in Sydney Australia. I am 28 and have been drafting for around 5.5yrs and curently have 2 other staff under me. I work for DSA Consulting which is a Mechanical HVAC (air conditioning) consultancy. I use just raw AutoCAD 2008 though have also used Drapro and Cad duct(just a little).
I will try the advice given and see how I go.
Thanks again
Stephen.
stephen.coff
2007-07-26, 02:10 AM
Tom,
I tried them though they didn't work. For some reason I hadn't really clicked as to what was happening and how you were getting the answers to rounding it off using the additional expressions. It all just clicked, ever so slowly. So i set it to decimal and rounded the answer to 1 decimal and then made the converstion factor 0.000001
This is what the feild expression reads:
%<\AcObjProp.16.2 Object(%<\_ObjId 2130597768>%).Area \f "%lu2%pr1%ps[,m2]%ct8[1e-006]">%
This is how I have used it though it still doesn't work, see below:
(setq newunits (setvar "insunits" 4))
(setq txt2 (strcat "%<\AcObjProp.16.2 Object(%<\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \f "%lu2%pr1%ps[,m2]%ct8[1e-006]">%"
)
)
)
It should display like this: 100.0m2
Instead i get: Command: ; error: bad argument type: stringp nil
Stephen
You've forgot about double backslashes i think
Change on this one, worked for me:
(setq txt2 (strcat "%<\\AcObjProp.16.2 Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu2%pr1%ps[, m2]%ct8[1e-006]\">%")
)
stephen.coff
2007-07-27, 05:25 PM
Fixo,
That was it, thank you heaps.
Stephen
stephen.coff
2007-07-27, 05:48 PM
Ha ha hah.
I simply copied what the feild expression showed and it only had 1 backslash, though it obviosuly required 2.
Thank you Fixo.
See routine below:
;;; Altered ARL.lsp by FIXO (AUGI) 22.07.07
(defun c:Atxt (/ rset useri1reset oldunits ssarch
adoc acsp ent obj myNum cpt
pt1 pt2 txt1 txt2 newunits
)
(vl-load-com)
(if (= (getvar "USERI1") 0)
(setvar "USERI1" 1)
(progn
(alert "\n USERI1 Is Not Set To: 1 ")
(initget 14 "R C")
(setq rset (getkword "Reset-R, Continue-C"))
(setq useri1reset
(cond ((= rset "R") (setvar "USERI1" 1)))
)
)
)
(command "tilemode" 1)
(command "-OSNAP" "ENDP,PER,NEA,CEN,NODE,QUA,INS,MID,INT")
(setq oldunits (getvar "insunits"))
(command "-layer" "unlock" "*" "")
(command "-layer" "lock" "-M-AREA" "")
(command "-layer" "m" "-M-ARCH" "C" "202"
"-M-ARCH" "Lt" "CONTINUOUS" "-M-ARCH"
"p" "n" "-M-ARCH" ""
)
(setq ssarch (ssget "_X"))
(Command "_chprop" ssarch "" "_LA" "-M-ARCH" "")
(command "-layer" "lock" "*" "")
(command "-layer" "m" "-M-AREA" "C" "20"
"-M-AREA" "Lt" "DASHED2" "-M-AREA" "p"
"n" "-M-AREA" ""
)
(command "-layer" "unlock" "-M-AREA" "")
(command "_style" "AREA" "arial" "250" "1" "0" "n" "n")
(or adoc
(setq adoc (vla-get-activedocument
(vlax-get-acad-object)
)
)
)
(or acsp
(setq acsp (vla-get-modelspace
adoc
)
)
)
(while
(setq ent
(entsel
"\nSelect The Polyline You Wish To Calculate Area For (ENTER to exit): "
)
)
(setq obj (vlax-ename->vla-object (car ent)))
(if (wcmatch (vla-get-objectname obj) "*Polyline")
(progn
(setq myNum (getvar "USERI1"))
(setq cpt (getpoint "\PICK LOCATION FOR AREA TEXT"))
(setq pt1 (mapcar '+ cpt (list 0 50 0)))
(setq pt2 (mapcar '+ cpt (list 0 -50 0)))
(setq txt1 (strcat "Zone " (itoa myNum)))
(command "_text" "style" "area" "justify" "bc" pt1 "0" txt1)
;;: Displayed In Meters To 1 Decimal Place.
(setq newunits (setvar "insunits" 4))
(setq txt2
(strcat "%<\\AcObjProp.16.2 Object(%<\\_ObjId "
(itoa (vlax-get obj 'ObjectID))
">%).Area \\f \"%lu2%pr1%ps[, m2]%ct8[1e-006]\">%"
)
)
)
(alert "THIS IS NOT A POLYLINE")
)
(command "_text" "style" "area" "justify" "Tc" pt1 "0" txt2)
(vla-regen adoc acallviewports)
(setvar "USERI1" (+ myNum 1))
(setq myNum (itoa myNum))
)
(command "plinewid" 0)
(command "insunits" oldunits)
(setvar "USERI1" 0)
(princ)
)
Stephen
Stephen
Frankly, I glad you solved it
Thanks for sharing with your final version
hope it will helps to somebody else
Happy computing :)
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.