Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/10/2020 in all areas

  1. hanphuc error in code (setq rad (getvar 'filletrad)) should be (setq rad (getvar 'filletrad) we all make typo's. It does not clean up the rectang was it meant to ? Makes fillet on opposite corner ? Started with plain RECTANG. Where as mine adds arc to pline. Not saying its perfect but seemed to work from the limited testing The CCW and CW is a pain to work around.
    1 point
  2. I posted an answer to this maybe here recently or else it was forums/Autodesk it asks for the text and uses that to join the circles the add layer linetype could be done easy.
    1 point
  3. Well, your code is prompting for the selection of a circle, not text, so how should it recognise the texts? If I'm understanding right, you prefer the same texts in the same unique layer with the linetype "CONTINUOUS". If that's the case, you can simply put it in, for example, "PLTRACE-kill1" layer or something like that. In my case... (defun c:textcircle ( / circles dets ent i pl ss texts txt unique) (defun unique (lst / rtn) (while lst (setq rtn (cons (car lst) rtn) lst (vl-remove (car lst) lst) ) ) (reverse rtn) ) (if (setq ss (ssget '((0 . "CIRCLE,TEXT,MTEXT")))) (progn (repeat (setq i (sslength ss)) (if (eq (cdr (assoc 0 (entget (setq ent (ssname ss (setq i (1- i))))))) "CIRCLE") (setq circles (cons ent circles)) (setq texts (cons ent texts)) ) ) (foreach x circles (if (setq txt (car (vl-member-if '(lambda (y) (equal (cdr (assoc 10 (entget x))) (cdr (assoc 11 (entget y))) 1e-8 ) ) texts ) ) ) (setq dets (cons (cons (cdr (assoc 1 (entget txt))) x) dets)) ) ) (foreach x (unique (mapcar 'car dets)) (if (> (length (setq pl (vl-remove-if-not '(lambda (y) (eq x (car y))) dets))) 1) ; If statement added to escape one-vertex segments (entmake (append '( (0 . "LWPOLYLINE") (100 . "AcDbEntity") (100 . "AcDbPolyline") (6 . "Continuous") ; <--- Adjusted linetype to Continuous ) (list (cons 90 (length pl)) (cons 8 (strcat "TEXTCIRCLE-" x)) ; <--- Line added, put in layer "TEXTCIRCLE-" followed by the text name. ) (apply 'append (mapcar '(lambda (y) (list (assoc 10 (entget (cdr y))) '(40 . 0) '(41 . 0) '(42 . 0) '(91 . 0) ) ) pl ) ) ) ) ) ; Close if ) ) ) )
    1 point
  4. Exactly this! Now I can adapt to my need. Thank you dlanorh.
    1 point
×
×
  • Create New...