You add this code
(setq x (/ allx ctr)
y (/ ally ctr)
pt (list x y)
arr2 (/ areaobj 9.1)
strmdll (strcat "div9=" (rtos arr2 2 precision))
)
(command "text" "j" "mc"
pt
(* sch 2.5)
"0"
strmdll
)
You fill the TextScreen wiht TooMany because You Use Command Line.
Current text style: "Standard" Text height: 1.250 Annotative: No
Specify start point of text or [Justify/Style]: j Enter an option
[Align/Fit/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR]: mc
Specify middle point of text:
Specify height <1.250>: 1.250000000000000
Specify rotation angle of text <0.0000g>: 0
Enter text: 2215.799
Command: text
Current text style: "Standard" Text height: 1.250 Annotative: No
Specify start point of text or [Justify/Style]: j Enter an option
[Align/Fit/Center/Middle/Right/TL/TC/TR/ML/MC/MR/BL/BC/BR]: mc
Specify middle point of text:
Specify height <1.250>: 1.250000000000000
Specify rotation angle of text <0.0000g>: 0
Enter text: 1266.097
Command: _.UNDO Current settings: Auto = On, Control = All, Combine = Yes,
Layer = Yes
Enter the number of operations to undo or [Auto/Control/BEgin/End/Mark/Back]
<1>: END
You must replace the (command "Layer" "make" ) wit, the function dfn_;layer_new is SelfChecking if-LayerExists
(defun dfn_layer_new(a245 coloriz on_off linetype / $rr co oo ex ge ax tip)
(setq;|a13651|;
$rr 0
tip (quote INT)
oo (if (= (type on_off) tip) on_off 0)
co (if (= (type coloriz) tip) coloriz 7)
ax (if (> a245 "") (strcase a245 T) "a245errorS")
ex (if (tblsearch "LAYER" a245) 1 0)) (if (= ex 0) (progn (setq;|a13911|;
ge (entmakex (list (cons 0 "LAYER") (cons 100 "AcDbSymbolTableRecord") (cons 100 "AcDbLayerTableRecord") (cons 2 ax) (cons 70 oo) (cons 62 co)))) (setq;|a14081|;
$rr (if ge 1 RTERROR)))) (if (< ex 0) (setq;|a14127|;
$rr -5003))
$rr)
//Out:rr:int=(rterror. internal failed)
// (1.okai layer created)
// (0.okai layer already exist)
// (rtrej. invalid file name)
How to Call ? (dfn_layer_new "namelayer" 10 1 "disabled-NowL:ineType")