I really don’t follow what you consider a “shape”, there are 51 separate entities in the DXF you posted. Most are Arcs and lines. To get the count of the entities, just use your len variable
I called them shapes because I did not know how else to describe them, it is actually 'pierce points I am after for a laser to cut out the profile in the dxf supplied it would be one for the outer profile and one each for the holes total of 14.
I don't know if that is even possible in Intellicad since the outer profile is made up of lines?
If it is possible how ould I add it to the code, someone has given me the auto write to xls below if I could get teh pierce point I would be complete.
(defun C:PEXPXL ( / ss lst fname fil sel2lst)
(defun sel2lst ( sel / l len )
(if (= 'PICKSET (type sel))
(repeat (setq len (sslength sel))
(setq len (1- len)
l (cons (ssname sel len) l)
(setvar "CMDECHO" 0)
(princ "\nSelect Circle,Polyline,Ellipse,Spline or Region")
(setq ss (ssget '((0 . "CIRCLE,*POLYLINE,ELLIPSE,REGION,SPLINE"))))
(setq lst (sel2lst ss))
(setq fname (getfiled "Select Excell file" "" "xls" 1))
(setq fil (open fname "w"))
(write-line "Object\tPerimeter" fil)
(foreach en lst
(command "_AREA" "_Object" en)
(write-line (strcat (cdr(assoc 0 (entget en)))"\t" (rtos (getvar "PERIMETER") 2 12)) fil)
(princ "\nPerimeter of ")(princ (length lst))
(princ " object export to ")(princ fname)
(princ "\nType PEXPXL to run")