Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/13/2024 in all areas

  1. When you respond "did not work" it does not tell us anything, need to know did you get error messages or wrong objects drawn. Please provide more details.
    1 point
  2. No worries as I had solved already the shortest side it was easy to do.
    1 point
  3. @leonucadomi Actually - I think this version will work better i it will prevent it from stripping other formatting for the reason Lee Mac noted here: ; Original by RonJonP, edited by P. Kenewell (defun c:ltx (/ o s) (setvar "cmdecho" 0) (command "._undo" "_be") (if (setq s (ssget ":L" '((0 . "*TEXT,DIMENSION")))) (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s))) (setq o (vlax-ename->vla-object e)) (cond ((= "TEXT" (cdr (assoc 0 (entget e)))) (vla-put-textstring o (strcat "%%U%%O" (vl-string-subst "" "%%U" (vl-string-subst "" "%%O" (vla-get-textstring o)) ) ) ) ) ((= "MTEXT" (cdr (assoc 0 (entget e)))) (vla-put-textstring o (strcat "\\L\\O" (vl-string-subst "" "\\L" (vl-string-subst "" "\\O" (vla-get-textstring o)) ) ) ) ) ((= "DIMENSION" (cdr (assoc 0 (entget e)))) (if (= (vla-get-textoverride o) "") (vla-put-textoverride o "\\L\\O<>") (vla-put-textoverride o (strcat "\\L\\O" (vl-string-subst "" "\\L" (vl-string-subst "" "\\O" (vla-get-textoverride o)) ) ) ) ) ) ) ) ) (command "._undo" "_end") (setvar "cmdecho" 1) (princ) )
    1 point
  4. Just need a repeat loop for the lines to be extended or trimmed. Use a ssget to select the objects then. (if (setq ss (ssget '((0 . "*LINE")))) (repeat (setq x (sslength ss)) (setq obj2 (vlax-ename->vla-object (ssname ss (setq x (1- x))))) is obj2 2 a line ? is obj2 a pline ? ) ) Good to see your trying to have a go at the code.
    1 point
  5. FYI when you need to set multiple variables (setq vars '(osmode snapang orthomode cmdecho) ;list of variables vals (mapcar 'getvar vars) ;store current values for restore in a list called 'vals ) (mapcar 'setvar vars '(0 0 1 0)) ;set new values setting osmode=0 snapang=0 orthomode=1 cmdecho=0 ;use this before you acually set the snapang so 0 is overwritten (mapcar 'setvar vars vals) ;restore old values
    1 point
×
×
  • Create New...