Hi,
This subject was diiscussed here recently and there's Tony's solution which
can be used without necessarely going to the learning curve, at least not
right now:
;;;=============================
(defun c:getarea ( / try-get-property ent area)
(vl-load-com)
;;;-------------------------------------
;;;The next function is by Tony Tanzillo
;;;-------------------------------------
(defun try-get-property (obj prop / result)
(vl-catch-all-apply
(function
(lambda ()
(setq result
(vlax-get-property obj prop)
)
)
)
)
result
)
(if (setq ent (car (entsel "\nSelect hatch: ")))
(if (= (cdr (assoc 0 (entget ent))) "HATCH")
(if
(setq area
(try-get-property
(vlax-ename->vla-object ent)
'Area
)
)
(princ (strcat "\nArea is " (rtos area)))
(princ "\nHatch has no area.")
)
(princ "\nSelection was not a hatch.")
)
(princ "\nNothing selected.")
)
(princ)
)
;;;=============================
HTH
"Rodney" a écrit dans le message de news:
6372206@discussion.autodesk.com...
Does anyone have no of a fix for the area command change in 2010. I have
several programs that I use the Area command with that no longer work.
Plines that cross over themselves are ignored, I use the area command then
pull the Perimeter setvar to get the length in several programs.
I know that I can use VL functions to in place of the area command for this
purpose but I don't have time right now to go thru the learning curve.
Thanks
Rodney