Jump to content

Hatch multiple polylines at their elevation


Recommended Posts

Posted

I have multiple closed polylines which i need to hatch. The Hatch needs to be at the elevation of the polylines. Currently i create multiple hatches and move them on by one througgh property pane or move command. Is there a way to eliminate this step and draw the hatches at the elevation of the objects?

Posted

Hatching is always in the plane of the current UCS.

 

Have you tried to write anything yourself yet?

Posted

Assuming the hatch is associative, try this:
 

(defun c:foo (/ lw s v)
  (if (setq s (ssget ":L" '((0 . "HATCH"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (and (setq lw (cdr (assoc 330 (reverse (entget e)))))
	   (setq v (cdr (assoc 38 (entget lw))))
	   (vla-put-elevation (vlax-ename->vla-object e) v)
      )
    )
  )
  (princ)
)

 

  • Thanks 1
Posted
1 hour ago, ronjonp said:

Assuming the hatch is associative, try this:
 


(defun c:foo (/ lw s v)
  (if (setq s (ssget ":L" '((0 . "HATCH"))))
    (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
      (and (setq lw (cdr (assoc 330 (reverse (entget e)))))
	   (setq v (cdr (assoc 38 (entget lw))))
	   (vla-put-elevation (vlax-ename->vla-object e) v)
      )
    )
  )
  (princ)
)

 

This works very well.

 

Posted
33 minutes ago, PrimeTimeAction said:

This works very well.

 

🍻

Posted

If the plines vertices are all at 1 elevation then why not use "ELEV" its built in.

 

image.thumb.png.39c4a529f4473c7b2032a8b94d8b309a.png

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