Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

In response to thread555-151638 1

Status
Not open for further replies.

Shage

Civil/Environmental
Jul 10, 2007
1
0
0
US
I have a question about thread555-151638

I am running AutoCad Civil 3D 2007 and attempted to run the gel lisp posted by IFRs (Petroleum) on 7 Apr 06 18:53

All lengths are calculated except for the polylines. It says "0 objects found" when selecting any polyline. Anyone with any suggestions?

CODE USED:

(DEFUN c:GEL ( / attr elength ss dst cnt) ; Adds the lengths of selected lines, arcs, circles, polylines, or splines
(setq dst 0 cnt 0)(setvar "cmdecho" 0)
(princ "= Get length... Adds the lengths of selected lines, arcs, circles, polylines, or splines ")
;
(DEFUN attr (ent indx)(cdr (assoc indx ent)))
;
(DEFUN elength (ent / sa ea)
(cond
((= (attr ent 0) "LINE")(distance (attr ent 10)(attr ent 11)))
((= (attr ent 0) "ARC")(setq sa (attr ent 50) ea (attr ent 51))
(* (if (> ea sa)(- ea sa)(+ (- ea sa)(* 2 pi)))(attr ent 40)))
((= (attr ent 0) "CIRCLE")(* 2 pi (attr ent 40)))
((= (attr ent 0) "POLYLINE")(command "area" "e" (attr ent
-1))(getvar "perimeter"))
((= (attr ent 0) "SPLINE")(command "area" "e" (attr ent
-1))(getvar "perimeter"))
)
)
(if (setq ss (ssget '((-4 . "<or")(0 . "LINE")(0 . "ARC")(0 .
"CIRCLE")
(0 . "POLYLINE")(0 . "SPLINE")(-4 .
"or>"))))
(progn
(repeat (sslength ss)
(setq dst (+ dst (elength (entget (ssname ss cnt)))) cnt (+ cnt
1))
)
(princ (strcat "\n The length of the entity or entities selected
is "(rtos dst 2 8)" "))
)
(princ "\n Input error... ")
)
(princ)
)
 
Replies continue below

Recommended for you

Status
Not open for further replies.
Back
Top