Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/24/2019 in all areas

  1. Try this: (defun artos (x / u i) ; Area Real To String - metric ;hanhphuc (eval (cons 'strcat (reverse (list (setq x (float x) u (if (< (setq i (/ (abs x) 1e+4)) 0.1) " m%%253" " ha" ) ) (cons 'rtos (if (= u " ha") (list (/ x 1e+4) 2 1) (list x 2 1) ) ) ) ) ) ) ) (defun c:a (/ en p) ; localized variables (while ; loop if entity is selected (and (setq en (car (entsel "\nPick area entity.. "))) ; select 2D entity (vlax-property-available-p (vlax-ename->vla-object en) 'area) ; check whether has 'area' property (setq p (getpoint "\nSpecify text placement point.. ")) ; locate text insertion point (entmakex (list '(0 . "TEXT") '(8 . "leg-area") ; to avoid command call (cons 1 (artos (vlax-curve-getarea en))) ; convert area value to string using sub function ;; (cons 7 "L80") (cons 10 (trans p 1 0)) ; text insertion point ;(cons 50 (* pi 0.5)) ; angle 90d (cons 40 (getvar 'textsize)) ; text height, command: textsize ) ) ) ) (princ) )
    1 point
  2. I flagged OP as a Spammer and removed link.
    1 point
  3. Hmm, I think the OP is probably a spammer. Notice the off-topic link. This technique is used quite often on the BricsCAD forum: Quote a message, copy-paste a message (sometimes from another forum), or add a vague comment, and hide some links. Source of the original message: https://stackoverflow.com/questions/23875094/stuck-in-autolisp-using-polar
    1 point
×
×
  • Create New...