Results 1 to 4 of 4

Thread: HELP ME ! ADDING LAYER BOUNDARY RECTANG IS WALL AND LAYER HATCH IS HATCH

  1. #1
    Member
    Join Date
    2020-04
    Posts
    4
    Login to Give a bone
    0

    Unhappy HELP ME ! ADDING LAYER BOUNDARY RECTANG IS WALL AND LAYER HATCH IS HATCH

    Code:
    (defun C:PZ ();
    (setq pnt1 (getpoint "Select upper left hand corner for placement of rectangle: "))
    (setq pnt2 (getcorner pnt1 "Select lower right hand corner for placement of rectangle: "))
    (command "rectangle" pnt1 pnt2)
    (setq ent1 (entlast))
    (command "-hatch" "P" "ANSI31" "1000" "0" "S" ent1"" "")
    Attached Files Attached Files
    Last edited by Opie; 2021-01-20 at 01:46 PM. Reason: [code] tags added for improved readability

  2. #2
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,667
    Login to Give a bone
    0

    Default Re: HELP ME ! ADDING LAYER BOUNDARY RECTANG IS WALL AND LAYER HATCH IS HATCH


  3. #3
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: HELP ME ! ADDING LAYER BOUNDARY RECTANG IS WALL AND LAYER HATCH IS HATCH

    Quote Originally Posted by Long Park View Post
    (defun C:PZ ();
    (setq pnt1 (getpoint "Select upper left hand corner for placement of rectangle: "))
    (setq pnt2 (getcorner pnt1 "Select lower right hand corner for placement of rectangle: "))
    (command "rectangle" pnt1 pnt2)
    (setq ent1 (entlast))
    (command "-hatch" "P" "ANSI31" "1000" "0" "S" ent1"" "")
    Give this a whirl..
    (of course you would need to edit the properties of those layers you mentioned, I used layer colors I use a lot)
    Code:
    (defun C:PZ (/ lyr LR1 LR2 ent1);
    (setq lyr (getvar "clayer"))
    (setq pnt1 (getpoint "Select upper left hand corner for placement of rectangle: "))
    (setq pnt2 (getcorner pnt1 "Select lower right hand corner for placement of rectangle: "))
    	(setq LR1 (tblsearch "layer" "WALL"));;checks to see if the layer exists already  
    	(setq LR2 (tblsearch "layer" "HATCH"));;checks to see if the layer exists already
    		(if (= LR1 nil)
    		(command "layer" "make" "WALL" "color" "3" "" "" "" "")) ;;edit for your desired layer properties
    		(if (= LR2 nil)
    		(command "layer" "make" "HATCH" "color" "150" "" "" "" "")) ;;edit for your desired layer properties
    (command "layer" "s" "WALL" "" "")
    (command "rectangle" pnt1 pnt2)
    (setq ent1 (entlast))
    (command "layer" "s" "HATCH" "" "")
    (command "-hatch" "P" "ANSI31" "1000" "0" "S" ent1"" "")
    (setvar "clayer" lyr)
    (princ)
    )
    Hope this helps.
    It was nice that you had a starting point to help you with.

    A few etiquette hints, please don't use UPPERCASE letters when posting questions, or explanation points (!), it comes across as shouting a demand, not a request.
    Also the thread title should just state it's purpose "please help with wall and hatch lisp" or similar, and then describe your issues in the body of the thread.
    Last edited by tedg; 2021-01-20 at 12:35 PM.

  4. #4
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    560
    Login to Give a bone
    0

    Default Re: HELP ME ! ADDING LAYER BOUNDARY RECTANG IS WALL AND LAYER HATCH IS HATCH

    Nice idea tedg for me if making a lot of lisps then I have a Autoload lisp and one of the defuns in it is laychk it does as it suggests does layer exist if not then make. So 1 line in code.

    (laychk "Abcdefg" 3 "Continous") or a simpler version that ignores color and line type (laychk1 "Abcdefg") and (laychk2 "Abcdefg" 3).

Similar Threads

  1. use rectang to form leadline.
    By 742850517357521 in forum AutoLISP
    Replies: 0
    Last Post: 2015-11-03, 11:13 AM
  2. Replies: 0
    Last Post: 2008-02-27, 10:08 PM
  3. Retain Hatch boundaries, not adding boundary
    By elaynemaydesign in forum AutoCAD General
    Replies: 2
    Last Post: 2006-05-15, 06:59 PM
  4. Select Hatch and Hatch Boundary as same time
    By pangell in forum AutoCAD General
    Replies: 1
    Last Post: 2006-04-19, 07:42 PM
  5. Rectang "Unknown command"
    By cpercy in forum AutoCAD General
    Replies: 2
    Last Post: 2005-06-06, 04:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •