See the top rated post in this thread. Click here

Results 1 to 2 of 2

Thread: Fix LISP with Rotate & Layer

  1. #1
    100 Club CADNate's Avatar
    Join Date
    2015-12
    Location
    Lovejoy, GA.
    Posts
    125
    Login to Give a bone
    0

    Default Fix LISP with Rotate & Layer

    Hi. I haven't played with AutoLISP in years and was never really proficient to begin with. I need some assistance in fixing this lisp. The top right rectangle need to rotate 90 degrees and line up next to the bottom rectangle. The layer needs to be set to a specific layer name "TOP". Any help would be appreciated.

    Code:
    ;;--------------=={ TOP.lsp }==--------------;;
    (defun c:TOP ()
      (setq l   (getdist "\nLength: ")
            w   (getdist "\nWidth: ")
            d   (getdist "\nDepth: ")
            gap (getdist "\Enter gap between views: ")
            p   (getpoint "\nSpecify lower left point: ")
      )
      (setq p1 p
            p2 (list (+ (car p) l) (+ (cadr p) w))
            p3 (list (+ (car p2) gap) (cadr p1))
            p4 (list (+ (car p2) gap d) (cadr p2))
            p5 (list (car p1) (- (cadr p1) gap d))
            p6 (list (car p2) (- (cadr p1) gap))
      )
      (setvar "osmode" 0)
      (setvar "cmdecho" 0)
      (command "rectang" p1 p2 "rectang" p3 p4 "rectang" p5 p6
              )
    
      (setvar "osmode" 703) ;your favourite osnap
      (setvar "cmdecho" 1)
      (princ)
    )
    Last edited by CADNate; 2019-09-05 at 01:56 PM. Reason: Please use [CODE] Tags

  2. #2
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    1

    Default Re: Fix LISP with Rotate & Layer

    Ok some hints car is X value cadr is y value get a pencil and go through your p1 p2 - p6 writing down x & y. Work out correct values for p5 p6

    Have a look at attachments its a library routine for multi line input.
    Code:
    (defun c:top ( / l w d gap p p1 p2 p3 p4 p5 p6)
    (setq oldlay (getvar 'clayer))
    (setvar 'clayer "TOP")
    ….
    …….
    (setvar 'clayer oldlay)
    (princ)
    
    )
    Attached Images Attached Images
    Attached Files Attached Files
    Last edited by BIG-AL; 2019-09-23 at 04:21 AM.

Similar Threads

  1. Rotate Project North - Fix needed
    By Wish List System in forum Revit Architecture - Wish List
    Replies: 1
    Last Post: 2016-04-15, 03:15 PM
  2. Replies: 0
    Last Post: 2013-04-17, 04:39 AM
  3. Fix the terrible rotate command
    By Scott Hopkins in forum Revit Architecture - Wish List
    Replies: 4
    Last Post: 2006-04-12, 02:45 PM
  4. Can't rotate crop regions to rotate view
    By Wes Macaulay in forum Revit Architecture - General
    Replies: 11
    Last Post: 2005-02-07, 04:46 PM
  5. Add Attribute Rotate in ROTATE command
    By arshadmirza786 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2005-01-12, 09:40 AM

Posting Permissions

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