Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Combining Copy & Align command?

9 REPLIES 9
Reply
Message 1 of 10
mb
3820 Views, 9 Replies

Combining Copy & Align command?

Usually the align command is used to just move objects, is there a way to copy objects & align them with others.
MB
9 REPLIES 9
Message 2 of 10
BillZ
in reply to: mb

If you wrote some code you could:
(defun cp_align ()
(command "copy" your objects here "" (list 0 0 0)(list 0 0 0))
(c:align)
)
Then use "P" to select the same objects you copied, then just finish the align comman manually....
Any other ideas guys & gals?
BillZ
Message 3 of 10
Martyn_Perrin
in reply to: mb

Have you tried the move/copy/rotate command (mocoro) that comes with the express tools menu?

express --> modify --> move copy rotate
Message 4 of 10
cvc-it-mb
in reply to: mb

This is way late.... 4 years later. But maybe someone will stumble upon this topic in searching....

(defun c:CA()(princ "\nCopyAlign")(c:copyalign)(princ))
(defun c:COPYALIGN (/ sSet P11 P12 P21 P22 1st 2nd)
;;Combines COPY and ALIGN commands
;;by Jim Smith 2002
(or(member "geom3d.arx" (arx))(arxload "geom3d" nil))
(command "_.undo" "_be")
(setq sSet (ssget))
(if sSet
(progn
(setq P11 (getpoint "Specify first source point: ")
P12 (getpoint P11 "\nSpecify first desintation point: ")
1st (cons 256 (list P11 P12)))
(grvecs 1st)
(setq P21 (getpoint "\nSpecify second source point: ")
P22 (getpoint P21 "\nSpecify second desintation point: ")
2nd (cons 256 (list P21 P22)))
(grvecs 2nd)
(command "_.COPY" sSet "" "0,0,0" "@")
(align sSet P11 P12 P21 P22 "" "")))
(setq sSet nil)
(grvecs (list P11 P12))(grvecs (list P21 P22))
(command "_.undo" "_e")
(princ)
)
Message 5 of 10
cvc-it-mb
in reply to: mb

Another method would be to COPYCLIP then ALIGN then PASTE.
Message 6 of 10
nnmohammed2013
in reply to: mb
Message 7 of 10
triantafil
in reply to: nnmohammed2013

that lisp works nice, but after undoing it unchecked my Snap selections..

Message 8 of 10
Sea-Haven
in reply to: triantafil

If it source lisp add (setvar 'osmode x) at end the x is your osnap settings value, just set all osnaps how you like and type osmode a number will appear

 

Did not download.

Message 9 of 10
ВeekeeCZ
in reply to: mb

Well, it's really old thread. I the meantime ALIGN moved from the express tools to the core, so I would use that...

 

(defun c:Coalign ( / s e)
    
  (if (and (setq s (ssget "_:L"))
	   (setq e (entlast))
	   (setq e (progn (while (entnext e) (setq e (entnext e))) e))
	   (vl-cmdf "_.copy" s "" "_non" '(0 0 0) "_non" '(0 0 0))
	   (setq s (ssadd))
	   )
    (progn
      (while (setq e (entnext e)) (ssadd e s))
      (command-s "_.align" s "")))
  (princ)
  )

 

Message 10 of 10
r.mahmoud2
in reply to: cvc-it-mb

After 13 years, I find this very useful... Thank you very much 🙂

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost