Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/02/2018 in all areas

  1. Hi, Give this a shot and let me know. (defun c:Test (/ text_ inc int sel ent get ins rot ang ctr) ;; Tharwat - 02.Dec.2018 ;; (defun text_ (ins str rot clr lay) (entmake (list '(0 . "TEXT") (cons 8 lay) (cons 62 clr) (cons 10 ins) '(40 . 1.1543) (cons 1 str) (cons 50 (if (and (> rot (* pi 0.5)) (< rot (* pi 1.5))) (+ rot pi) rot ) ) '(41 . 1.0) '(71 . 0) '(72 . 1) (cons 11 ins) '(73 . 2) ) ) ) (if (setq inc 0 int -1 sel (ssget '((0 . "INSERT"))) ) (while (setq ent (ssname sel (setq int (1+ int)))) (setq get (entget ent) ins (cdr (assoc 10 get)) rot (cdr (assoc 50 get)) ang (+ rot (* pi 1.5)) inc (1+ inc) ) (mapcar 'text_ (list (polar ins ang 1.97715) (polar ins ang 3.96145) (setq ctr (polar ins ang 7.0083)) ) (list (strcat "X:" (rtos (car ins) 2 2)) (strcat "Y:" (rtos (cadr ins) 2 2)) (if (< inc 10) (strcat "0" (itoa inc)) (itoa inc) ) ) (list rot rot rot) '(2 2 1) '("Coordenada" "Coordenada" "N_Postes") ) (entmake (list '(0 . "CIRCLE") '(8 . "N_Postes") (cons 10 ctr) '(62 . 1) '(40 . 1.5) ) ) ) ) (princ) )
    1 point
  2. Welcome to CADTutor Unfortunately, it's not a simple change - replace lines 59-86 (inclusive): (if (= 1 (sslength sel)) (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " (LM:ObjectID (vlax-ename->vla-object (ssname sel 0))) ">%).Area \\f \"" fmt "\">%" ) ) (progn (repeat (setq idx (sslength sel)) (setq lst (vl-list* "%<\\AcObjProp Object(%<\\_ObjId " (LM:ObjectID (vlax-ename->vla-object (ssname sel (setq idx (1- idx))))) ">%).Area>%" " + " lst ) ) ) (setq str (strcat "%<\\AcExpr " (apply 'strcat (reverse (cdr (reverse lst)))) " \\f \"" fmt "\">%" ) ) ) ) With the following code: (repeat (setq idx (sslength sel)) (setq lst (vl-list* "%<\\AcObjProp Object(%<\\_ObjId " (LM:ObjectID (vlax-ename->vla-object (ssname sel (setq idx (1- idx))))) ">%).Area>%" " + " lst ) ) ) (setq str (strcat "%<\\AcExpr (Trunc((" (apply 'strcat (reverse (cdr (reverse lst)))) ")/0.5)*0.5) \\f \"" fmt "\">%" ) )
    1 point
×
×
  • Create New...