Hi , I need how to store the last value of last result?
Eg.1 the "Y" is last-value of previous-call
Eg.2.
IF I call (dfn_getx_readkey "[YNA]" "Continue to Process (y;n)(a.abort)" )
I select "A" abort at readkey.
THEN the function keep inside (list of dfn_getx_readkey), he keep "A".
He replace the "Y" with the "A".(He=dfn_getx_readkey)
He or other replace inside the body. he replace the "Y" with the "A".(He=dfn_getx_readkey)
ENDIF Thank you.
#region
pp_hatcharea
(defun pp_hatcharea
(fmtstr
/ sos sumarea areaedit idx hostpoint lodctr nop ent eon lpt color msgwap sizeh umax.txt chk paintext bbroken ask
) /*c2s:
vl_load_com();
readme.txt="01.First Scan all Hatch/s and remove all brokenHatch(s)",
sos
=(sos
==nil)?
ssget("X",fmtstr
):sos,
sumarea=0.0,
areaedit=0.0,
"\n02.Draw Table of Area(s)",
"\n03.I have lisp to to label the hatch area for one hatch at insertion point",
"\n04.Can anyone help me to modify the lisp to make it sum more than one hatch and"));
for(idx=0;idx<sslength(sos);idx=idx+1)
eon=vlax.ename->vla_object(ent),
chk
=(vl.catch_all_error_p
(setq(areaedit,vl.catch_all_apply
(read("vlax-get"),
list(eon,
quote(Area
))))))?
nil:T,
bbroken
=(chk
==nil)?
ssadd(ent,bbroken
):bbroken,
nop
=(chk
==nil)?
ssdel(ent,sos
):
nil,
sumarea
=(chk
&&numberp(areaedit
))?
(sumarea
+areaedit
):sumarea
;
hostpoint
=(hostpoint
==nil)?
getvar("VIEWCTR"):hostpoint,
idx=(idx<2)?2:idx,
readme.txt="Calculate average of square->sizeh",
readme.txt
=php_echo
(list("\nCount BrokenHatch(s)=",ask,
"=")),
color=1;
ask=(ask>0)?dfn_getx_readkey("[AB]","Which type/s of Hatch/s ?(B-broken.hatch)(A.all-okai):"):"A",
sos=(ask=="B")?bbroken:sos;
for(idx=0;idx<sslength(sos);idx=idx+1)
eon=vla_getboundingbox(ent),
loadctr
=dfn_point_midi
(car(eon
),
cadr(eon
),
nil),
nop=dfn_enamk_line(loadctr,hostpoint,"",color,nil),
areaedit
=(ask
=="A")?vlax.get
(last(eon
),
read("Area")):
nil,
msgwap
=(ask
=="A")?
strcat("Sqmeter=",
rtos(areaedit,
2,
2),
"m²,",
"SquareFoot=",
rtos(10.7639*areaedit,
2,
3),
"ft²,",
"Acre=",
rtos(0.000247105*areaedit,
2,
3),
"ac²,",
"SqYard=",
rtos(1.19599*areaedit,
2,
3),
"yard²;"):
nop=dfn_enamk_text(hostpoint,sizeh,msgwap,nil,nil,nil,color,""),
color=color+1,
color=(color>191)?1:color,
hostpoint
=dfn_point_midi
(hostpoint,
list(0,sizeh
*1.9780209,
0),
1.0);
areaedit=sumarea,
msgwap
=strcat("Sqmeter=",
rtos(areaedit,
2,
2),
"m²,",
"SquareFoot=",
rtos(10.7639*areaedit,
2,
3),
"ft²,",
"Acre=",
rtos(0.000247105*areaedit,
2,
3),
"ac²,",
"SqYard=",
rtos(1.19599*areaedit,
2,
3),
"yard²;"); */
msgwap)