Haggbakk Posted August 4, 2010 Posted August 4, 2010 Hi everyone! Managed to create a lisp that changes hatch pattern via "-hatchedit". Worked fine when testing on one hatch but when testing the lisp out on several hatches in same model the problems occured. Seems like Hatchedit command only work on one hatch at a time. Anyone got an idea how to edit multiple hatch patterns with one click? Quote
lpseifert Posted August 4, 2010 Posted August 4, 2010 you could make a selection set of the hatches and cycle through them to use "-hatchedit" on each one. Quote
Haggbakk Posted August 4, 2010 Author Posted August 4, 2010 My thoughts were going to that direction too, but I've got no idea how to do that. I'va Googled it without finding any good answers. How do I create a cycle? Quote
lpseifert Posted August 4, 2010 Posted August 4, 2010 have a look here http://www.afralisp.net/autolisp/tutorials/selection-sets.php Quote
Haggbakk Posted August 4, 2010 Author Posted August 4, 2010 Ah, thank you. Visited that page earlier today, close but no cigar... I give it a try. Quote
abugintheground Posted August 9, 2010 Posted August 9, 2010 I've just had a similar problem, and found the easiest thing to do was to edit the properties of one and then use MATCHPROP to copy those settings to the others. Is that what you wanted to do? Quote
Tharwat Posted August 9, 2010 Posted August 9, 2010 My thoughts were going to that direction too, but I've got no idea how to do that. I'va Googled it without finding any good answers. How do I create a cycle? Here is a selection set cycle you can start with, and you should complete the rest ... (defun c:example (/ ss a ent ents) (if (setq ss (ssget '((0 . "HATCH")))) (progn (setq a -1) (while (setq ent (ssname ss (setq a (1+ a)))) (setq ents (entget ent)) (vl-cmdf "_.-hatchedit" ents .............) ) (princ) ) ) (princ) ) hope this clear to you to give a start. Best regards, Tharwat Quote
Haggbakk Posted August 13, 2010 Author Posted August 13, 2010 I've just had a similar problem, and found the easiest thing to do was to edit the properties of one and then use MATCHPROP to copy those settings to the others. Is that what you wanted to do? Good idea, but did you use MATCHPROP in a lisp? For me it jumps out of command line and asks me to pick from the view... Quote
Lt Dan's legs Posted August 13, 2010 Posted August 13, 2010 try alias for matchprop = MA Maybe you can modify this (defun c:test (/ ent) (while (not (and (setq ent (car (entsel "\nSpecify hatch patern: "))) (setq ent (entget ent)) (eq "HATCH" (cdr (assoc 0 ent))) ) ) (prompt "\nPlease Select a hatch") ) (entmod (subst (cons 2 "AR-SAND")(assoc 2 ent) ent)) (princ) ) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.