+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 16
  1. #1
    Senior Member Rooster's Avatar
    Using
    AutoCAD 2012
    Join Date
    Jun 2005
    Posts
    234

    Question Help editing this LISP

    Registered forum members do not see this ad.

    Got a really simple LISP file that I run which combines the 'move' & 'rotate' commands. What I need is for someone to help me switch this around so that it runs the 'rotate' command first, and then the 'move' one. Here's the contents of the file:

    (defun c:mr ()
    (princ "\nMove & Rotate:\n")
    (setq ss (ssget))
    (command "move" ss "" "0" "0")(command "move" ss "" pause pause)(command "rotate" ss "" "@" pause))

    Thanks

  2. #2
    Super Member CAB's Avatar
    Using
    AutoCAD 2000
    Join Date
    May 2004
    Location
    Tampa, Florida
    Posts
    801

    Default

    Code:
    (defun c:rm (/ ss)
      (princ "\nSelect Objects to Rotate & Move:\n")
      (if (setq ss (ssget))
        (progn
          (command "rotate" ss "" "@" pause)
          (command "move" ss "" pause pause)
        )
      )
      (princ)
    )

  3. #3
    Senior Member Rooster's Avatar
    Using
    AutoCAD 2012
    Join Date
    Jun 2005
    Posts
    234

    Default

    Thanks CAB - that's great (almost!).

    Only problem is that it doesn't ask me for a base point to rotate from....??

  4. #4
    Super Member CAB's Avatar
    Using
    AutoCAD 2000
    Join Date
    May 2004
    Location
    Tampa, Florida
    Posts
    801

    Default

    That wasn't in your specifications.
    Code:
    (defun c:rm (/ ss)
      (princ "\nSelect Objects to Rotate & Move:\n")
      (if (setq ss (ssget))
        (progn
          (command "rotate" ss "" pause pause)
          (command "move" ss "" pause pause)
        )
      )
      (princ)
    )

  5. #5
    Senior Member Rooster's Avatar
    Using
    AutoCAD 2012
    Join Date
    Jun 2005
    Posts
    234

    Default

    Perfect - thankyou!

  6. #6
    Super Member
    Using
    AutoCAD not applicable
    Join Date
    Jul 2007
    Posts
    639

    Default

    Rooster you do realize CAB just reversed your original LISP

    The section in your original LISP wouldn't have asked for a base point either

    Code:
    (command "rotate" ss "" "@" pause))

    Not being picky..
    If at first you don't succeed, then maybe failure is more your style.

  7. #7
    Senior Member Rooster's Avatar
    Using
    AutoCAD 2012
    Join Date
    Jun 2005
    Posts
    234

    Default

    Can I ask for one last ammendment to this?!

    Could the 'move' section of this command use the same base point asked for during the 'rotate' stage? Thanks

  8. #8
    Banned Alan Cullen's Avatar
    Using
    Map 3D 2009
    Join Date
    Jun 2006
    Location
    Cairns, Queensland, Australia
    Posts
    4,181

    Default

    Try this:

    Code:
    (defun c:rm (/ ss)
      (princ "\nSelect Objects to Rotate & Move:\n")
      (if (setq ss (ssget))
        (progn
          (setq pt (getpoint  "\n     Select Base point : "))
          (command "rotate" ss "" pt pause)
          (command "move" ss "" pt pause)
        )
      )
      (princ)
    )

  9. #9
    Senior Member Rooster's Avatar
    Using
    AutoCAD 2012
    Join Date
    Jun 2005
    Posts
    234

    Default

    No, that works the same as before. It asks me for a base point twice - once to rotate around, and then to move from. What I want is to pick a base point, rotate the object around it, and then go straight to the move command keeping the same base point.....

  10. #10
    Luminous Being dbroada's Avatar
    Computer Details
    dbroada's Computer Details
    Operating System:
    XP Pro
    Computer:
    Dell
    CPU:
    Intel Xeon 2.13GHz
    RAM:
    2GB
    Graphics:
    NVIDA Quadro FX 580
    Monitor:
    DELL 23" & SAMSUNG 21"
    Discipline
    Electro/Mech
    dbroada's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Electro/Mech
    Using
    Electrical 2013
    Join Date
    Nov 2005
    Location
    Sussex, UK
    Posts
    5,028

    Default

    Registered forum members do not see this ad.

    it works as expect here
    "That's it. It's one thing for a ghost to terrorize my children, but quite another for him to play my Theremin." Homer Simpson

    Dave

Similar Threads

  1. pdf editing
    By sexyicon in forum AutoCAD Beginners' Area
    Replies: 17
    Last Post: 21st Jan 2008, 08:32 pm
  2. problem, trying to running a list of lisp from within a lisp
    By twind2000 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 20th Aug 2007, 04:27 pm
  3. Lisp routine for Intellicad editing
    By romparkin in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 13th Apr 2007, 09:03 am
  4. Need help with editing lisp routine
    By romparkin in forum AutoLISP, Visual LISP & DCL
    Replies: 17
    Last Post: 3rd Apr 2007, 08:02 am
  5. CUI Editing
    By thalon in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 2nd Apr 2007, 10:39 pm

Bookmarks

Posting Permissions

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