Results 1 to 5 of 5

Thread: Mover

  1. #1
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    38
    Login to Give a bone
    0

    Post Mover

    Hi, what am I doing wrong? Why doesn't my selected object move??

    Code:
    (defun c:mover (/ ObjToMove pt1 pt2)
    
    (setvar "cmdecho" 0)
    (command "_.undo" "begin")
    
    (setq ObjToMove (entsel "Move what?:"))
    (setq pt1 (cdr ObjToMove))
    (setq ObjToMove (car ObjToMove)) 
    (setq pt2 (getpoint "Where?"))
    (command "_.move" ObjToMove pt1 pt2)
    
    (command "_.undo" "end")
    (setvar "cmdecho" 1)
    (princ)
    )
    Last edited by rkmcswain; 2014-01-20 at 09:55 PM. Reason: add [CODE] tags
    Tuomo

  2. #2
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,779
    Login to Give a bone
    0

    Default Re: Mover

    Try this:

    Code:
    (defun c:mover (/ ObjToMove pt1 pt2)
    
    (setvar "cmdecho" 0)
    (command "_.undo" "begin")
    
    (setq ObjToMove (entsel "Move what?:"))
    (setq pt1 (cadr ObjToMove))
    (setq ObjToMove (car ObjToMove)) 
    (setq pt2 (getpoint "Where?"))
    (vl-cmdf "_.move" ObjToMove "" pt1 pt2)
    
    (command "_.undo" "end")
    (setvar "cmdecho" 1)
    (princ)
    )
    R.K. McSwain | CAD Panacea |

  3. #3
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    38
    Login to Give a bone
    0

    Default Re: Mover

    Thanks!

    Next wondering how to make it loop..
    Tuomo

  4. #4
    All AUGI, all the time Tharwat's Avatar
    Join Date
    2010-06
    Posts
    922
    Login to Give a bone
    0

    Default Re: Mover

    Quote Originally Posted by tuomo.jarvinen View Post

    Next wondering how to make it loop..
    Just add While function before the the complete line for the entsel function

  5. #5
    Member tuomo.jarvinen's Avatar
    Join Date
    2015-09
    Location
    Jyväskylä, Finland
    Posts
    38
    Login to Give a bone
    0

    Default Re: Mover

    That easy! Thanks!!!

    Code:
    (defun c:mover (/ ObjToMove pt1 pt2)
    
    (setvar "cmdecho" 0)
    (command "_.undo" "begin")
    
    (while
    (setq ObjToMove (entsel "Move what?:"))
    (setq pt1 (cadr ObjToMove))
    (setq ObjToMove (car ObjToMove)) 
    
    (setq pt2 (getpoint "Where?"))
    (command "_.move" ObjToMove "" pt1 pt2)
    )
    
    (command "_.undo" "end")
    (setvar "cmdecho" 1)
    (princ)
    )
    Last edited by rkmcswain; 2014-01-21 at 01:28 PM. Reason: added [CODE] tags
    Tuomo

Similar Threads

  1. Mover um objeto, sem utilizar o comando "move" no lisp
    By Edmar Cristiano in forum Português - Customização / Programação
    Replies: 1
    Last Post: 2013-07-30, 02:28 AM
  2. PROBLEMAS AL MOVER COSAS EN DIBUJOS GRANDES.
    By cfleiss774351 in forum Español - CHAT
    Replies: 0
    Last Post: 2011-10-17, 10:25 AM
  3. Selecionar e mover um bloco?
    By eugeniocunha in forum Português - Customização / Programação
    Replies: 4
    Last Post: 2009-05-27, 06:57 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
  •