keiths Posted May 18, 2015 Share Posted May 18, 2015 Hi, Is is possible to hatch a box automatically when using PL. I want to be able to trace around an object and soon as I close the PL it will hatch. all help appreciated, Keith Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 18, 2015 Share Posted May 18, 2015 Easy done via lisp ; create pline by picking points press enter when finished (command "_pline") (while (= (getvar "cmdactive") 1 ) (command pause) ) (command "-hatch" "S" "L" "" "") ;do stuff here like pattern rotation scale Quote Link to comment Share on other sites More sharing options...
keiths Posted May 19, 2015 Author Share Posted May 19, 2015 Thanks BIGAL Just a little lost how to enter the code... Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted May 19, 2015 Share Posted May 19, 2015 Thanks BIGAL Just a little lost how to enter the code... So a more turn key solution would look something like this, using ANSI31 pattern, at scale 10.5, rotation 0. (defun c:polyhat () ; create pline by picking points press enter when finished (command "_pline") (while (= (getvar "cmdactive") 1 ) (command pause) ) (command "-hatch" "S" "L" "" "_P" "ANSI31" "10.5" "0.0" "") ) Save that code into a file using NOTEPAD. Name the file POLYHAT.LSP (make sure to enclose the file name in quotes when saving so that it won't append the "TXT" file extension) Drag+drop the file into the AutoCAD editor. (It may complain about the location of the file not being secure - see this for more info) Type in the command POLYHAT. Start creating... Quote Link to comment Share on other sites More sharing options...
jipix Posted March 2, 2016 Share Posted March 2, 2016 Hi rkmcswain, I'm looking for this function. But, i want integrate it in a macro in my tool palette, without call LISP or other macro. pline command, worked. hatch command on the last object, worked. But, the second function after the first, in same time, with cmdactive variable doesn't work ... Have u an issue ? (In LISP case, the function is perfect) Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted March 2, 2016 Share Posted March 2, 2016 If you just want a hatch button in the tool palette, then forget about lisp, macros, and everything else. Just create a hatch object in a drawing, set the properties like you want, then drag and drop this hatch object into the tool palette. From that point on, you can create that hatch using the new tool palette button - no programming needed. Quote Link to comment Share on other sites More sharing options...
jipix Posted March 4, 2016 Share Posted March 4, 2016 I want to do the same thing that BIGAL. Draw a pline and "autohatch" it. Except that I want to find the synthax to integrate it in my macro field. That's possible ? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted March 4, 2016 Share Posted March 4, 2016 A couple of ways copy the code to the file acaddoc.lsp it will then auto load it for you then just type polyhat, or you can edit the tool palette to ^c^cpolyhat or ^c^c(load "polyhat")(command "polyhat") Quote Link to comment Share on other sites More sharing options...
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.