Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/10/2019 in all areas

  1. (defun c:t5 ( / b l e d i s) (while (setq b (cdadr (tblnext "block" (not b))))(setq l (cons b l))) (foreach b l (setq e (tblobjname "block" b)) (while (setq e (entnext e))(if (= (cdr (assoc 0 (setq d (entget e)))) "HATCH")(entmod (append (subst (cons 8 "rlx") (assoc 8 d) d) '((62 . 256))))))) (if (setq s (ssget "x" '((0 . "HATCH")))) (repeat (setq i (sslength s))(entmod (append (subst (cons 8 "rlx") (assoc 8 (setq d (entget (ssname s (setq i (1- i)))))) d) '((62 . 256)))))) (command "_.regen") (princ) )
    1 point
  2. Hi @rlx A few info if you don't mind of course. cons function can create the layer name "rlx" if its not already existed in the drawing file that included in the pair list as this => (cons 8 "rlx") You can shorten the program via removing the progn function and add the entmod right before the subst function like this: (entmod (subst .... etc
    1 point
  3. oh very well then, pic size optimized (defun c:t2 ( / ss i f e l) (vl-load-com) (if (setq f (getvar 'dwgprefix) ss (ssget "x" '((0 . "TEXT")))) (repeat (setq i (sslength ss)) (if (wcmatch (cdr (assoc 1 (entget (setq e (ssname ss (setq i (1- i))))))) "S#,S##") (setq l (cons e l))))) (if l (progn (princ "\nWorking.....") (command "._undo" "_mark") (mapcar '(lambda (x y)(vl-catch-all-apply 'setvar (list x y))) (list 'filedia 'cmdecho 'expert) '(0 0 2)) (vl-catch-all-apply 'vl-cmdf '("._tilemode" 0 "._erase" "_all" """._mview" "0,0" "2.2,1.5" "._zoom" "_e" "._mspace")) (mapcar '(lambda (x / p s) (setq p (cdr (assoc 11 (entget x))) s (cdr (assoc 1 (entget x)))) (vl-catch-all-apply 'vl-cmdf (list "._zoom" "c" (mapcar '+ p '(3 0)) 1.5 "_jpgout" (strcat f s) "w" (mapcar '+ p '(1.9 -0.75)) (mapcar '+ p '(4.1 0.75)) ""))) l) (mapcar '(lambda (x y)(vl-catch-all-apply 'setvar (list x y))) (list 'filedia 'cmdecho 'expert) '(1 1 0)) (vl-catch-all-apply 'vl-cmdf '("._pspace" "._undo" "_back")) ) ) (princ "\nDone") (princ) )
    1 point
×
×
  • Create New...