PDA

View Full Version : Routine to globally set all hatches to non associative?


Mr Cory
2007-06-08, 01:55 AM
Does anyone have a routine to globally set all hatches to non associative?

Cheers Cory

paulmcz
2007-06-08, 04:13 AM
Does anyone have a routine to globally set all hatches to non associative?

Cheers Cory

I have this:
(defun c:qass (/ ss sl ct e1)
(command "cmdecho" (getvar "cmdecho"))
(if (setq ss (ssget '((0 . "HATCH") (71 . 1))))
(setq sl (sslength ss)
ct (- sl 1)
)
(princ "\n No associative hatch found! ")
)
(if ss
(repeat sl
(setq e1 (entget (ssname ss ct)))
(entmod (subst (cons 71 0) (assoc 71 e1) e1))
(setq ct (- ct 1))
)
)
(princ)
)
(prompt "\n Type > qass < to remove hatch associativities: ")

Mr Cory
2007-06-08, 04:16 AM
Thats exactly what i was after Thanks Paul!

Just one thing, where and what would i add to make it do it automatically?

paulmcz
2007-06-08, 02:08 PM
You are welcome.

This will select and process all associated hatches automatically.

(defun c:qass (/ ss sl ct e1)
(command "cmdecho" (getvar "cmdecho"))
(if (setq ss (ssget "_x" '((0 . "HATCH") (71 . 1))))
(setq sl (sslength ss)
ct (- sl 1)
)
(princ "\n No associative hatch found! ")
)
(if ss
(repeat sl
(setq e1 (entget (ssname ss ct)))
(entmod (subst (cons 71 0) (assoc 71 e1) e1))
(setq ct (- ct 1))
)
)
(princ)
)
(prompt "\n Type > qass < to remove hatch associativities: ")

Mr Cory
2007-06-10, 11:03 PM
Perfect thanks again! :)