+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Feb 2011
    Posts
    48

    Default Separate/copy layer to other place by user pick point then sorting them..

    Registered forum members do not see this ad.

    Separate/copy layer to other place by user pick point then sorting them horizontal

    below code not sorting horizontal.how to change the code, become horizontal (see image attached)

    Code:
    (defun c:test1 ( / _move d ss l lst ) (vl-load-com)
      (defun _move ( obj p q dist )
        (vla-move (setq obj (vla-copy obj)) (vlax-3D-point p) (vlax-3D-point q))
        (vla-move obj (vlax-3D-point '(0. 0. 0.)) (vlax-3D-point (list dist 0. 0.)))
      )
      (if
        (and
          (ssget "_:L")
          (setq p1 (getpoint "\nBase Point: "))
          (setq p2 (getpoint "\nDesired Location: " p1))
          (setq p1 (trans p1 1 0) p2 (trans p2 1 0))
        )
        (progn
          (vlax-for obj (setq d 10. ss (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object))))
            (_move obj p1 p2
              (cond
                ( (cdr (assoc (setq l (vla-get-layer obj)) lst)) )
               ((cdr (assoc (vl-string-right-trim "D" l) lst)))
                     ((cdr (assoc (strcat l "D") lst)))
                ( (setq lst (cons (cons l (setq d (- d 650.))) lst)) d )
              )
            )
          )
          (vla-delete ss)
        )
      )
      (princ)
    )
    Attached Images

  2. #2
    Full Member
    Using
    AutoCAD 2013
    Join Date
    Feb 2011
    Posts
    48

    Default

    Registered forum members do not see this ad.

    any ideal guys

Similar Threads

  1. Replies: 9
    Last Post: 3rd Jul 2012, 09:16 pm
  2. Replies: 3
    Last Post: 16th Feb 2012, 09:48 pm
  3. Measure & place objct in specific length at curve & pick their placing cords & Export
    By samcoozy in forum AutoCAD Drawing Management & Output
    Replies: 1
    Last Post: 30th Jan 2012, 02:55 am
  4. help needed with Pick-and-place animation
    By coilspring in forum Autodesk Inventor
    Replies: 3
    Last Post: 25th Oct 2011, 06:56 pm
  5. Tough Question - Layer Locking (Make Layer Visible But No Pick)
    By johnshar123xx in forum AutoCAD General
    Replies: 1
    Last Post: 21st Nov 2008, 03:20 pm

Tags for this Thread

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