james9710 Posted 8 hours ago Posted 8 hours ago hi, can someone please assist me on creating a lisp: create polyline then after closing, it will automatically create a solid hatch within the closed polyline. hatch should be solid and layer is as per current. command should be PLH big thanks. we are working on large scale landscape projects that need hatches of each area of soft scape and hardscape Quote
devitg Posted 6 hours ago Posted 6 hours ago @james9710 please upload your sample dwg where you will apply such lisp Quote
BlackBox Posted 6 hours ago Posted 6 hours ago Without using Visual LISP reactors, here's a starting point: (defun c:PLH (/ pt) (entlast) (command "._pline") (while (and (not (initget 32)) (if pt (setq pt (getpoint pt)) (setq pt (getpoint)) ) ) (command pt) ) (command "_c") (command "._-hatch" "_p" "_s" "_co" "." "." "_la" "." "_s" (ssadd (entlast)) "" "" ) (princ) ) 1 Quote
pkenewell Posted 6 hours ago Posted 6 hours ago (edited) @BlackBox Beat me to the Punch! @james9710 Here is my version - as simple as I can make it: (defun C:PLH (/ e el) (command "._pline") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (if (and (setq e (entlast)) (setq el (entget e)) (= (cdr (assoc 0 el)) "LWPOLYLINE") (= (logand (cdr (assoc 70 el)) 1) 1) ) (command "._-hatch" "_pro" "_S" "_S" e "" "") (princ "\nInvalid Polyline Created (Must be complete and Closed).") ) (princ) ) Edited 5 hours ago by pkenewell 2 Quote
BlackBox Posted 5 hours ago Posted 5 hours ago (edited) 1 hour ago, pkenewell said: @BlackBox Beat me to the Punch! @james9710 Here is my version - as simple as I can make it: (defun C:PLH (/ e el) (command "._pline") (while (= (logand (getvar "cmdactive") 1) 1) (command pause) ) (if (and (setq e (entlast)) (setq el (entget e)) (= (cdr (assoc 0 el)) "LWPOLYLINE") (= (logand (cdr (assoc 70 el)) 1) 1) ) (command "._-hatch" "_pro" "_S" "_S" e "" "") (princ "\nInvalid Polyline Created (Must be complete and Closed).") ) (princ) ) '... as simple'... using logand. (chortles) Teeheehee Props though, as yours allows arcs, etc... Well done Edited 5 hours ago by BlackBox 1 Quote
pkenewell Posted 3 hours ago Posted 3 hours ago 14 minutes ago, BlackBox said: '... as simple'... using logand. (chortles) Teeheehee Props though, as yours allows arcs, etc... Well done @BlackBox Thanks! (yeah - logand is fairly advanced, but shorter lol) 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.