Results 1 to 2 of 2

Thread: LISP to create layer, hatch and set layer back to original.

  1. #1
    I could stop if I wanted to jpcadconsulting347236's Avatar
    Join Date
    Login to Give a bone

    Default LISP to create layer, hatch and set layer back to original.


    I'm trying to create a short lisp routine to trigger form a tool palette icon (I'll explain why later).

    here is the code as I have it (and it ALMOST works)

    ^C^C(setq CLAORIG (getvar "CLAYER")) (command "-layer" "m" "L-HTCH-SCRN-MEDM" "C" "8" "L-HTCH-SCRN-MEDM" "") (command "-hatch" "P" "ANSI31" "4" "45" "a" "a" "y" "" (setvar "CLAYER" CLAORIG))
    As you can see, it does the following:

    1. Stores the current layer value in CLAORIG (works fine)
    2. Creates a layer called L-HTCH-SCRN-MEDM and makes it current (works fine)
    3. Issues the hatch command (works fine)
    4. Sets the layer back to CLAORIG (doesn't work)

    Now... here is why I want to do this. When I create a hatch icon on a tool palette tab by dragging a hatch onto it, it works great except it does not allow the user to select between "pick internal point" and "select boundary objects" it only allows "pick internal point". In a complex drawing (which we have a lot of), this can be a slow process.

    So, any help is appreciated!!!

    Thanks all.

    Last edited by BlackBox; 2013-12-11 at 06:26 PM. Reason: Please use [CODE] Tags

  2. #2
    Administrator Opie's Avatar
    Join Date
    jUSt Here (a lot)
    Login to Give a bone

    Default Re: LISP to create layer, hatch and set layer back to original.

    You need to complete the last command function before setting the system variable. In other words, check your parenthesis locations.
    If you have a technical question, please find the appropriate forum and ask it there.
    You will get a quicker response from your fellow AUGI members than if you sent it to me via a PM or email.

Similar Threads

  1. Create layer lisp problem in R2012
    By marc.verdaasdonk697335 in forum AutoLISP
    Replies: 15
    Last Post: 2012-12-04, 12:34 PM
  2. Replies: 20
    Last Post: 2012-10-13, 07:16 PM
  3. Replies: 4
    Last Post: 2009-04-07, 01:18 PM
  4. Draw Viewport on correct Layer then switch back to original Layer
    By steve459238 in forum AutoCAD Customization
    Replies: 10
    Last Post: 2006-11-11, 12:03 PM
  5. Replies: 8
    Last Post: 2006-10-28, 09:47 PM

Tags for this Thread

Posting Permissions

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