I have a routine that I wrote using 2004. I sent the file along to a machine using 2002. One of the functions is looking for length and area properties in a nested or non-nested closed polyline. On my machine it finds both and everything's great, but on the 2002 machine it acts like a polyline doesn't have a length. I assume on any version there should be a length property to a pline. Here is the code, can any 2002 users replicate this problem:
(defun len-area (/ vl-obj)
(cond ((setq nent (nentsel "\nSelect Object to check "))
(setq vl-obj (vlax-ename->vla-object (car nent)))
(cond ((and (= (vlax-curve-getEndParam vl-obj) 1.0)
(vlax-property-available-p vl-obj 'length)
)
(setq pipe-len (vla-get-length vl-obj)
len-ft (strcat (rtos (/ pipe-len 12) 2 0)
"'"
)
)
)
((> (vlax-curve-getEndParam vl-obj) 1.0)
(if (vlax-property-available-p vl-obj 'length)
(setq pipe-len (vla-get-length vl-obj)
len-ft (strcat (rtos (/ pipe-len 12) 2 0)
"'"
)
)
)
(if (vlax-property-available-p vl-obj 'area)
(setq pipe-area (vla-get-area vl-obj)
area-ft (strcat (rtos (/ pipe-area 144) 2 0)
"'"
)
)
)
)
)
)
)
)
Yes, I wrote this the day I read Stig's tutorial on curve's. Who knew I'd need it so quick.
Sorry, the other code was not tested right. This one should do better.