Offset

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.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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. ___

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

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.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
in my original post I meant arx not shx, I was working with text stuff at the time.

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
snipped-for-privacy@myemail.com (Chris) wrote:

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) )
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
(defun C:OFFCIR (/ n os io dat orad nrad ndat) (while (not (setq ss (ssget '((0 . "CIRCLE")))))) (setq n (1- (sslength ss)) os (getdist "\nEnter offset distance: ") );;setq (initget "Inside Outside") (setq io (getkword "\nInside or Outside <O>?")) (while (>= n 0) (setq dat (entget (ssname ss n)) orad (cdr (assoc 40 dat)) nrad (if (= io "Inside")(- orad os)(+ orad os)) ndat (subst (cons 40 nrad)(assoc 40 dat) dat) n (1- n) );;setq (entmake ndat) );;while
;;Select the line below to do what you wish ;; with the original circles:
; (command "_.erase" ss "") ; (command "_.chprop" ss "" "_la" "[LayerName]" "")
(princ) );;defun ___

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
That works very well, Paul.
Turvill) wrote:

<SNIP>
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
207.115.17.102:

there wasn't a prompt to erase the originals.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
They are erases automatically if you take the semicolon out of this line:
; (command "_.erase" ss "")
to read:
(command "_.erase" ss "")
(Chris) wrote:

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
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]". ___

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Got ya. Works perfectly. Thanks alot.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hi Chris, as alternative for offset alls circle,here cod
(defun c:oc (
(i (setq ss (ssget "x" '((0 "CIRCLE"))) (prog (setq cnt 0 (setq ssl (sslength ss) (initget "I O" (setq opt (getkword "\nSelect offse [(I)nside/(O)utside]<O> ") (repeat ss     (setq ssn (ssname ss cnt)     (setq sse (entget ssn)     (setq cp (cdr (assoc 10 sse))     (setq rad (cdr (assoc 40 sse))     (if (= opt nil)(setq opt "O")     (i      (= opt "O"      (prog      (setq dis (* rad 0.25)      (setq pt (polar cp 0 (+ rad (* ra 0.5)))      (command "_offset" dis ssn pt ""      ) ; prog      (prog      (setq dis (* rad 0.25)      (setq pt (polar cp 0 (- rad (* ra 0.5)))      (command "_offset" dis ssn pt ""      ) ; prog      ) ; i     (setq cnt (1+ cnt)     ) ; repea ) ; prog (alert "\nInvalid selected object,please tr again" ) ; i (princ ) ; defu > Chriswrote in my original post I meant arx not shx, I was working with tex stuff at

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.