Jump to content

Recommended Posts

Posted

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?

Posted

you could make a selection set of the hatches and cycle through them to use "-hatchedit" on each one.

Posted

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?

Posted

Ah, thank you. Visited that page earlier today, close but no cigar... :) I give it a try.

Posted

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?

Posted
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

Posted
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...

Posted

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)
)

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...