Search the Community
Showing results for tags 'hatch solid pattern'.
-
Changing a hatch pattern scale, from a solid hatch
CesarA posted a topic in AutoLISP, Visual LISP & DCL
I've read the documentation in the autocad site and to change from solid to other kind of hatch you must mess up 2 dxf codes. 70 is 1 or 0 accordingly to solid or not. 2 is the hatch patern indeed. and finally 41 is the dxf for the scale of the pattern. So I tried to do the following: (defun c:efg ( / trama solido e o s x texto tipodepeca z y) (if (setq s (ssget "_:L" '((0 . "HATCH")))) (repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i))) x (entget e) trama (cdr (assoc 2 x)) solido (cdr (assoc 70 x)) ) (setq z (entmod (subst 0 solido x))) ;;;; change the dxf 70 from 1 (solid) to 0 (not solid) (if (= trama "SOLID") (progn (setq y (entmod (subst '(8 . "est.Trama") (assoc 8 x) z))) ;;;; Changes layer (setq w (entmod (subst '(2 . "AR-CONC") (assoc 2 x) y))) ;;;;Changes type of hatch (entmod (subst '(41 . 0.01) (assoc 41 x) w)) ;;;;Changes pattern scale (or shouldn't?) ) ) ) ) (princ) ) Basically I change the dxf 70 from 1 to 0 (so that I can enable a not-solid hatch) and then change the dxf 2 to other pattern. The problem is that everything works allright, but the scale pattern doesnt change. (the layer and the hatch name are correct). Does this have to do with the order in which I modify the settings?