move entities

Discussion in 'AutoCAD' started by Phil, Jun 9, 2004.

  1. Phil

    Phil Guest

    Is it possible to use the (command "move"... with a selection set or a
    list of entities, and how would it be done.

    My function creates text and line objects and then needs to move the
    group as a whole depending on the size of the text objects utilizing
    textbox.
     
    Phil, Jun 9, 2004
    #1
  2. Phil

    Steve Doman Guest

    Phil,

    Not sure if I understand your question, so please excuse if this seems
    to basic. If you have a selection set, you can supply that set as an
    argument to the command function:

    ;; Select objects
    (setq ss (ssget))

    ;; Do the move
    (command ".move" ss "" "0,0" "2,2")


    On the other hand, if you have a list of enames, you can create pickset
    and feed that to the command function:

    ;; Assuming e1 e2 e3 e4 are enames
    (setq elist (list e1 e2 e3 e4))

    ;; Initialize a pickset
    (setq ss (ssadd))

    ;; Add the enames from the list to the pickset
    (mapcar '(lambda (e) (ssadd e ss)) elist)

    ;; Do the move
    (command ".move" ss "" "0,0" "2,2")

    Steve Doman
     
    Steve Doman, Jun 9, 2004
    #2
  3. Phil

    Phil Guest

    Thanks that answers it. I did try the selset without success. I think
    I missed something in the command line.
     
    Phil, Jun 9, 2004
    #3
  4. Phil

    Steve Doman Guest

    wElcoMe!
     
    Steve Doman, Jun 9, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.