Jump to content

Hatch multiple polylines at their elevation


PrimeTimeAction

Recommended Posts

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?

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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.

 

Link to comment
Share on other sites

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