TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: hudster on April 13, 2004, 06:58:39 AM
-
I'm looking for a lisp which will let me rotate all selected blocks, but at each individual block insertion point, rather than rotating everything at one insertion point.
If anyone has a lisp which can do this can you please post it here.
cheers
Andy
-
you can do that through the "Properties" dialogue box ~ the Rotation is defined under the Miscellaneous section
-
Cool.
Cheers
-
I have one I can send you in email, but it will have to wait until I get home so I can get access to my computer.
-
......but it will have to wait until I get home so I can get access to my computer.
and you posted this by ...
telepathy ?[/list:u]
-
I am at work and I don't have it here....
-
(defun geninfo ()
(setq ename (ssname ss cnt)
elist (entget ename)
insp (cdr (assoc 10 elist))
cnt (1+ cnt)
) ;_ SETQ
)
(defun c:rbi ()
(setq ss (ssget)
cnt 0
)
(if (>= (setq ang (getangle "\nSpecify reference angle <0>: ")) 0.0)
(setq ang ang)
(setq ang 0.0)
)
(setq curval (angtos ang 0 2)
newval (angtos (getorient "\nSpecify new angle: ") 0 2)
)
(repeat (sslength ss)
(geninfo)
(command ".rotate" ename "" insp "R" curval newval)
)
(princ)
)
Will this do? I haven't used it in a long time, but I think that is what I wrote it for.
-
:D Something I've always wanted to do,being able to rotate mutliple objects with one base point.
-
Ok try this one....
;;;----------------------------------------------------------------------------
;;;
;;; RMANY.LSP Version 2.0
;;;
;;; Copyright (C) 1998-2004 by K. Blackie
;;;
;;; Permission to use, copy, modify, and distribute this software
;;; for any purpose and without fee is hereby granted, provided
;;; that the above copyright notice appears in all copies and that
;;; both that copyright notice and this permission notice appear in
;;; all supporting documentation.
;;;
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
;;; PURPOSE AND OF MERCHANTABILITY ARE HEREBY DISCLAIMED.
;;;
;;; 14 March 1998
;;; 26 November 1999
;;; 12 January 2004
;;;
;;;----------------------------------------------------------------------------
;;; DESCRIPTION
;;;----------------------------------------------------------------------------
;;; C:RMANY
;;;
;;; This function allows a user to rotate many objects at once by
;;; selecting several objects and then specifying a rotation angle.
;;; Note however that the rotation angle will be from the current
;;; angle of the entity, ie. if the current angle is 45 degrees and
;;; you specify rotation of 45 degrees the new angle of the entity
;;; will be 90 degrees.
;;;
;;; Changes in version 2.0 include the ability to select a multiple
;;; number of entities and rotate them individually around its own
;;; axis at a specified angle or rotate them individually by specifying
;;; an angle for each entity. This option puts the object at the angle
;;; specified from 0 degrees
;;;
;;;----------------------------------------------------------------------------
(defun C:RMANY( / ss ans oce)
(setq oce (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
(princ "\nSelect objects to rotate: ")
(setq ss (ssget))
(initget "Each Auto")
(setq ans (getkword "\nEach/<Auto>: "))
(do_each ans ss )
(setvar "CMDECHO" oce)
)
(defun do_each ( eoa ss / ssl rpt ca ra i do-once )
(setq ssl (sslength ss))
(setq i 0)
(repeat ssl
(setq rpt(cdr(assoc 10(entget(setq e(ssname ss i))))))
(cond
((= eoa "Each")(setq ra (getangle rpt "\nRotation angle: ")))
((not do-once)(setq ra (getstring "\nRotation angle: "))(setq do-once T))
)
(if do-once
(command "rotate" e "" rpt ra)
(progn
(if (= (cdr(assoc 50 (entget e))) nil)
(entmod (subst (cons 11 (polar rpt ra (distance rpt (cdr(assoc 11(entget e)))))) (assoc 11 (entget e))(entget e)))
(entmod (subst (cons 50 ra)(assoc 50 (entget e))(entget e)))
)
)
)
(setq i (+ 1 i))
)
)
(princ "\n -- Multiple Object Rotate Ver. 2.0 -- start command with --> RMANY ")
(princ "\n -- Copyright (C) 1998-2004 by K.E. Blackie ")
(princ)