Changing multiple hatches of same hatch type and layer

Changing multiple hatches of same hatch type and layer

Maltezc
Advocate Advocate
930 Views
2 Replies
Message 1 of 3

Changing multiple hatches of same hatch type and layer

Maltezc
Advocate
Advocate

hi all, 

 

i'm trying to select and change all hatches AR-SAND on layer a-ceil-grid and then only change the scale. The issue is that if I have multiple hatches on this layer and this type, it will only work on the very first hatch i put in the file. So everything is working correctly, its just that i can only change one hatch of the multiple hatches that are in the file

 

is there a way to select all the hatches of this type and on this layer?

 

here is my code: 

 

(defun C:Hatch_Edit_A-CEIL-GRID (/ ss old_CMDECHO)
(setq old_CMDECHO (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
;;(setq ss (ssget "X" '((2 . "AR-SAND"))))
(setq ss (ssget "X" '((2 . "AR-SAND")(8 . "a-ceil-grid"))))
(command "-hatchedit" ss "p" "AR-SAND" "10" "")
(Setvar "CMDECHO" old_CMDECHO)
(princ)
)

 

all help is appreciated !

0 Likes
Accepted solutions (1)
931 Views
2 Replies
Replies (2)
Message 2 of 3

pbejse
Mentor
Mentor
Accepted solution

@Maltezc wrote:

...., its just that i can only change one hatch of the multiple hatches that are in the file

 

is there a way to select all the hatches of this type and on this layer?

 

here is my code: 

all help is appreciated !


hatchedit is a one selection operation You can iterate thru the selection and modify each selected hatch one by one

 

(defun C:Hatch_Edit_A-CEIL-GRID	(/ ss old_CMDECHO)
  (setq old_CMDECHO (getvar "CMDECHO"))
  (setvar "CMDECHO" 0)
   (setq ss (ssget "X" (list '(2 . "AR-SAND") '(8 . "a-ceil-grid")(cons 410 (getvar 'ctab)))))
  	(repeat (sslength ss)
  		(command "-hatchedit" (ssname ss 0) "p" "AR-SAND" "10" "")
	  	(ssdel (ssname ss 0) ss)
	  )
  (Setvar "CMDECHO" old_CMDECHO)
  (princ)
)

also keep in mind, that a call to a "command" function can only processed what is on the current space [ you can read about it from the previous thread  you posted earlier ]

 

HTH

0 Likes
Message 3 of 3

Maltezc
Advocate
Advocate

thank you so much!!! now i dont have to open a bunch of files!!!!!! 😄

 

so money!

0 Likes