Jump to content

Recommended Posts

Posted

is it possible to select a number of objects and get the info for them.

Such as a number of polylines forming areas and getting the total area or the very least a list of the individual areas.

Answers on a post card please.

Posted

Yes it is. Search this site for lisp routines.

Small enough?

Posted

thanks but i should of said its for an LT user?

Posted
thanks but i should of said its for an LT user?

 

That's a pity. But may be for full version users:

 

(defun c:surea(/ iCnt cCur cAre oNam tAre)
 
 (vl-load-com)
 
 (setq iCnt 0 tAre 0.0)
 (princ "\n<<< Pick curves to measure areas, Spacebar for Total >>>")
 (princ "\n---------------------------------------------------- ")
 (while(setq cCur(entsel ""))
   (princ(strcat "\n" (itoa(setq iCnt(1+ iCnt))) " "))
   (if(or
 (vl-catch-all-error-p
 (setq cAre(vl-catch-all-apply 'vlax-curve-getArea
   (list(car cCur)))))
   (= 0.0 cAre)
 ); end or
     (princ "\n<!> Can't measure area for this entity <!> ")
     (progn
(setq oNam(substr(vla-get-ObjectName(vlax-ename->vla-object(car cCur)))5))
(princ " ")
(repeat(- 4(strlen (itoa iCnt)))(princ " "))
(princ oNam)
(repeat(- 10(strlen oNam))(princ " "))
(princ(rtos cAre))
(if(not(vlax-curve-isClosed(car cCur)))
  (princ "  (non closed!)")
  ); end if
(setq tAre(+ tAre cAre))
); end progn
     ); end if
   ); end while
 (textscr)
 (princ "\n---------------------------------------------------- ")
 (princ(strcat "\nTotal entities: " (itoa iCnt) ", Total area = " (rtos tAre)))
 (princ)
 ); end of c:surea

 

Usage example:

 

[color="#800080"]<<< Pick curves to measure areas, Spacebar for Total >>>
----------------------------------------------------
1     Polyline  44421990.2003
2     Polyline  12365838.5665
3     Polyline  64633994.1523  (non closed!)
4     Arc       19236282.9623  (non closed!)
5     Ellipse   29217657.8478
6     Circle    34015807.281
7     Polyline  44421990.2003
----------------------------------------------------
Total entities: 7, Total area = 248313561.2107[/color]

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...