jake77777 Posted September 26, 2010 Posted September 26, 2010 I do look for answers to these questions a minimum of an hour before I'll post anything. I know I'm up to 3 or 4 today. But or all you code geniuses..your help again..will be greatly be appreciated! (can you blame me..i just discovered lisps and this site today!) But what I was hoping you guys can help me out with was a lisp to select a boundary, then create an ansi 31 hatch, angle 180, and scale of 18 and remove boundary after. Everything would be on by layer or if there needs to be a layer selected it would be STR-TXT. What I've found closest is followed below..It changes the color of the layer to cyan for some reason, it does give the option to remove the boundary but haven't figured how to get it to work....also the scale was much smaller. Thanks for any suggestions! (defun c:QH( / cla) (command "_.-layer" "_N" "STR-TXT" "_M" "STR-TXT" "_C" "_T" "0,179,179" "STR-TXT" "" ) (command "_-color" "bylayer") ;(setvar "cmdecho" 0) ;(command "hpgaptol" 05) ;(command "HPNAME" "solid") ;(graphscr) (command "-hatch" "s" "pause" "") (setvar "cmdecho" 1) (princ) ) Quote
Ahankhah Posted September 26, 2010 Posted September 26, 2010 jake77777, I don't understand your purpose, but want to notify you about a mistake in your code. Indeed PAUSE is a variable to send a backslash (in VuisualLISP: "\\") to autocad's command prompt, so the code when invoking "HATCH" command, must be changed to: (command "-hatch" "s" pause "") Mehrdad http://www.irancad.com Quote
BlackBox Posted September 26, 2010 Posted September 26, 2010 This should help you get started... (defun c:QH (/ eName) (if (and (setq eName (car (entsel "\n >> Select Polyline Boundary: "))) (wcmatch (cadr (assoc 0 (entget eName))) "*POLYLINE")) (progn [color=seagreen];; ...Add You Code Here[/color] (command "._erase" eName "") ) (princ)) Quote
jake77777 Posted September 26, 2010 Author Posted September 26, 2010 Thanks for your help Ahankah & Renderman..think I'm going to try and go a different route and make my hatch using mlines..Thanks Again! Quote
jake77777 Posted September 26, 2010 Author Posted September 26, 2010 ..maybe NOT through mlines 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.