Does anyone know of a way to offset a large group of items in a drawings. Say you have a drawing with 50 circles and you need to offset them is there a command, lisp or shx that will do this? I found a lisp called offset all but it doesn't let you offset more than one item at a time.
I suppose it could be handled by LISP, but it isn't exactly a trivial undertaking, since each offset requires a selection of an item, plus a pick to indicate on which side the offset object is to be placed.
In your example of circles, I suppose the routine could ask for a distance and a choice of "inside" or "outside" ... and treat all of the circles similarly. Is this what you have in mind? Would you need to consider other types of objects as well? If so, the problem becomes increasingly complex. ___
"Paul Turvill" wrote in news:dijhuf$59b$ snipped-for-privacy@domitilla.aioe.org:
That's about what Im looking for. I have a plasma cutting table here at the shop I work at and we need to offset holes .125 to compensate for the cut. Say I have an array of 50 holes I just want to be able to select them all, choose the distance and to which direction and erase or put the original on a different layer.
If the holes are all the same radius, perhaps this (or something similar) would fit the bill. Note that there are two versions quoted.
I have tried the first routine as it stands and it does change all the holes with the specified radius to the newly defined radius. I haven't checked the second routine.
Brian.
;|
********************************************
CHRAD.LSP - (c) 1998 Tee Square Graphics *
********************************************
Two utilities to globally change the radius of existing circles in an AutoCAD drawing.
CAUTION: This is "demonstration" level software, and has no error traps or other refinements. These enhancements are left to the discretion of the end user. Both of the commands defined below will select ALL circles of the chosen "old radius" and change all to the "new radius." To allow the user to select a superset of objects to be scanned, remove the "x" from the (ssget...) function in either case:
(setq ss (ssget (list '(0 . "CIRCLE")(cons 40 or))))
********************************************
CHRAD command uses (command...) function and appears to be somewhat faster where the change of radius is fairly small. |; (defun C:CHRAD (/ or nr ss) (setq ce (getvar "cmdecho") or (getdist "\nOld radius: ") nr (getdist "\nNew radius: ") ss (ssget "x" (list '(0 . "CIRCLE")(cons 40 or)))) (if ss (progn (setvar "cmdecho" 0) (command "_.change" ss "" "" nr) (while (= (logand (getvar "cmdactive") 1) 1) (command nr)) (setvar "cmdecho" ce)) (alert (strcat "No " (rtos or) " radius circles found."))) (princ) ) ;|
********************************************
CHRAD1 command uses (entmod...) and is considerably faster where the change of radius is large. |; (defun C:CHRAD1 (/ or nr ss n obj) (setq or (getdist "\nOld radius: ") nr (getdist "\nNew radius: ") ss (ssget "x" (list '(0 . "CIRCLE")(cons 40 or))) n 0) (if ss (while (< n (sslength ss)) (setq obj (entget (ssname ss n)) obj (subst (cons 40 nr)(assoc 40 obj) obj) n (1+ n)) (entmod obj)) (alert (strcat "No " (rtos or) " radius circles found."))) (princ) )
Paul you rule. That works great. I need to learn how to write those programs but I have only been using CAD for about 6 months. Thanks again this helps bigtime.
Look closely; the code provides for both options you mentioned, near the end. Just remove the ";" at the start of the appropriate line. If you use the "chprop" option to move the original circles to a new layer, you'll also have to supply the actual layer name in place of "[LayerName]". ___
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.