Area of Polyline & Multiply by
Hi,I am in need of a lisp to do the following
Find the individual area of poly line in layer 1 & Layer 2
Multiply the area in layer 1 by a factor 3.1 and Place text within polyline
Multiply the area in layer 2 by factor 4.1 and Place text within polyline
Sum of text as alert message
Please help me on this..
Thanks in Advance
Suriwaits (defun c:areafrom(/ data TotalArea ss i en area lay) (setq data '(("LAYER1" 3.1) ("LAYER2" 4.1)));;vla-object en) 'mn 'mx) (setq pt (mapcar '(lambda (x y) (* 0.5 (+ x y))) (vlax-safearray->list mn) (vlax-safearray->list mx))) (entmakex (list (cons 0 "TEXT") (cons 10 pt)(cons 8 lay) (cons 11 pt) (cons 40 TextHt) '(72 . 1) '(73 . 2) (cons 1 (rtos (setq area (* (cadr (assoc lay data)) area)) 2 2)) ) ) (setq TotalArea (cons area TotalArea)) ) (alert (Strcat "Total area: " (rtos (apply '+ TotalArea) 2 2))) ) ) (princ))
Code updated Exactly what i am looking for.
I appreciate you can help me to control the size of text We can add a prompt for Text Height. Which one did you use? Demo or Demo2? I used Demo2.
Is it possible to write the area value divided by 1000000 incase i use in mm units.
See update code at post # 2
HTH Awesome!
Thanks agian pBe for your efforts
I have changed factor for mm 0.000001 insted of 0.001 since it is area.
Oh yeah.. silly me.. Glad i could help
页:
[1]