Results 1 to 5 of 5

Thread: Move with previous

  1. #1
    I could stop if I wanted to
    Join Date
    2015-12
    Posts
    385
    Login to Give a bone
    0

    Default Move with previous

    Hey all,
    Frequently I find I need to select Previous so I decided to add Previous as a default selection.
    Any comments or simplifications are appreciated, so what do you think?

    Code:
    (defun c:m (/ ss1)
      (setq ss1 (ssget));specify selection set
      (if (= ss1 nil) (setq ss1 (ssget "_P")));if nothing selected use previous selection
      (if (/= ss1 nil) (command "move" ss1 ""));autocad move command with previous selection
      (princ))
    Thanks,
    Andre

  2. #2
    All AUGI, all the time
    Join Date
    2015-10
    Location
    Belgrade, Serbia, Europe
    Posts
    564
    Login to Give a bone
    0

    Default Re: Move with previous

    Andre, have look at his code...

    http://www.theswamp.org/index.php?to...1693#msg481693

    M.R.

  3. #3
    Member
    Join Date
    2015-10
    Location
    Alhambra
    Posts
    27
    Login to Give a bone
    0

    Default Re: Move with previous

    You would not need to use the ssget lisp call because AutoCAD has a built in command called: Select
    Also I would not define a command with a single letter like m
    Typically M would be the alias for AutoCAD's standard Move command.
    You may want to call it mm?
    So I would change the code to this:
    Code:
    (defun c:mm () ; define autolisp function called mm
      (command"_.Select") ; start AutoCAD's Select command
      (while (= 1 (logand 1 (getvar 'CMDACTIVE))) (command pause)) ; continue to pause till Select command is complete
      (command "_.Move" "_P" "") ; AutoCAD Move command with previous selection
      (princ)
    )
    Area Object Link | Attribute Modifier | Dwg Setup | Feet-Inch Calculator | Layer Apps | List on Steroids | VP Zoom Scales
    Exchange App Store
    Paul Li
    Senior Associate
    ALTOON PARTNERS LLP
    Los Angeles • Amsterdam • Shanghai
    617 West 7th Street • Suite 400 • Los Angeles • California • 90017-3889
    D +1 213 225 1944 • T +1 213 225 1900 • www.altoonpartners.com
    Last edited by BlackBox; 2014-10-22 at 12:55 PM. Reason: Please use [CODE] Tags

  4. #4
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,719
    Login to Give a bone
    0

    Default Re: Move with previous

    Code:
    (defun c:FOO (/ ss)
      (command "._move" (if (setq ss (ssget "_:L")) ss "_p") "")
      (princ)
    )
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

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

    Default Re: Move with previous

    One more option.

    From my ACADDOC.lsp file
    Code:
    (defun c:prev (/)(sssetfirst nil (ssget "P"))(princ))
    (defun c:lastob (/)(sssetfirst nil (ssget "L"))(princ))
    These visibility select so you can see what you're working with before starting a modify command.

    I have a Select drop-down added to my "Object Snap Cursor Menu" with a variety of selection options.

Similar Threads

  1. Add a “move up/move down” and "add multiple" options to parameters
    By Wish List System in forum Revit MEP - Wish List
    Replies: 2
    Last Post: 2014-08-07, 03:42 AM
  2. 2012: How to SNAP to point on SPHERE for move/3D MOVE?
    By rick663901 in forum AutoCAD 3D (2007 and above)
    Replies: 3
    Last Post: 2012-09-19, 07:59 AM
  3. Move site or move project?
    By jwilhelm in forum Revit Architecture - General
    Replies: 4
    Last Post: 2009-05-27, 06:42 AM
  4. Replies: 3
    Last Post: 2008-12-29, 10:58 AM
  5. Dimension points do not move when using the Move command
    By sudhirkizhakoote in forum AutoCAD General
    Replies: 6
    Last Post: 2005-10-16, 05:33 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
  •