Jump to content

Multiple Offset


daiharv

Recommended Posts

  • Replies 24
  • Created
  • Last Reply

Top Posters In This Topic

  • fuccaro

    3

  • BIGAL

    3

  • cntrk77

    3

  • daiharv

    2

It's always wise, with new software, to check under "Help" to see if there have been any improvements to commands.

 

Yes, there is a "multiple" option available in AutoCAD 2007. The exact text reads:

 

"Specify point on side to offset or [Exit/Multiple/Undo]." At this prompt, type "M" for multiple.

 

The next prompt will read:

 

"Specify point on side to offset or [Exit/Undo] ." That's where you pick the second object you wish to offset. However, keep in mind, the offset distance will be the same as it was for the first object.

Link to comment
Share on other sites

In that case call me wise!

 

Unfortunately what you I may have not maid clear enough for some people, is that I needed to be able select multiple objects to offset in one go, not have to select one object, then offset, than another object, which would only be marginally quicker than the ordinary select.

 

Thankfully others did understand what I was after and sent through a lsp routine (see below).

 

;| OFFSET POLYLINES

mfuccaro@hotmail.com September 2003

|;

(defun c:pof( / plines ; selection set of polylines

ext ; extrnal point

dist ; distance to offset

poly ; a polyline from plines

plist ; the list of poly

del ; polyline to delete

int ; internal point

i)

(command "undo" "begin")

(princ "select polylines")

(setq plines (ssget)

i 0

ext (getvar "limmax")

dist (getdist "distance"))

(repeat (sslength plines)

(setq poly (ssname plines i))

(setq plist (entget poly))

(command "offset" dist poly ext "")

(setq del (entlast)

int (polar

(cdr (assoc 10 (entget del)))

(angle

(cdr (assoc 10 (entget del)))

(cdr (assoc 10 plist)))

(* 2 (distance (cdr (assoc 10 plist))

(cdr (assoc 10 (entget del)))))))

(command "offset" dist poly int "")

(entdel del)

(setq i (1+ i)))

(command "undo" "end")

(if (= "Y" (strcase (getstring "\ndelete initial polylines? (Y/N)")))

(command "erase" plines ""))

)

Link to comment
Share on other sites

Sorry mate, my mistake. Glad to see someone rode to your rescue. Always a good day when one learns something new. Thank you mfuccaro.

Link to comment
Share on other sites

  • 9 months later...
In that case call me wise!

 

Unfortunately what you I may have not maid clear enough for some people, is that I needed to be able select multiple objects to offset in one go, not have to select one object, then offset, than another object, which would only be marginally quicker than the ordinary select.

 

Thankfully others did understand what I was after and sent through a lsp routine (see below).

 

;| OFFSET POLYLINES

mfuccaro@hotmail.com September 2003

|;

(defun c:pof( / plines ; selection set of polylines

ext ; extrnal point

dist ; distance to offset

poly ; a polyline from plines

plist ; the list of poly

del ; polyline to delete

int ; internal point

i)

(command "undo" "begin")

(princ "select polylines")

(setq plines (ssget)

i 0

ext (getvar "limmax")

dist (getdist "distance"))

(repeat (sslength plines)

(setq poly (ssname plines i))

(setq plist (entget poly))

(command "offset" dist poly ext "")

(setq del (entlast)

int (polar

(cdr (assoc 10 (entget del)))

(angle

(cdr (assoc 10 (entget del)))

(cdr (assoc 10 plist)))

(* 2 (distance (cdr (assoc 10 plist))

(cdr (assoc 10 (entget del)))))))

(command "offset" dist poly int "")

(entdel del)

(setq i (1+ i)))

(command "undo" "end")

(if (= "Y" (strcase (getstring "\ndelete initial polylines? (Y/N)")))

(command "erase" plines ""))

)

 

 

 

Dear sir,

 

Thanks for your lisp code but i would like to ask you it is possible to select external offset instead of internal?

 

Regards.

Link to comment
Share on other sites

:thumbsup:

 

 

Hi,

 

i have loaded your multiple offset lisp code succesfully but it offset internal we cannot offset to outside. How can we solve this problem is it possible to choose int or external?

 

Best Regards,

ilke

Link to comment
Share on other sites

Here is a quick and dirty fix:

 
(defun c:pof1 (/ plines ; selection set of polylines
      ext ; extrnal point
      dist ; distance to offset
      poly ; a polyline from plines
      plist ; the list of poly
      del ; polyline to delete
      int ; internal point
      i)
 (command "undo" "begin")
 (princ "select polylines")
 (setq plines (ssget)
i      0
ext    (getvar "limmax")
dist   (getdist "distance")
 )
 (repeat (sslength plines)
   (setq poly (ssname plines i))
   (setq plist (entget poly))
   (command "offset" dist poly ext "")
   ;(setq del (entlast)
   ;int (polar
   ;(cdr (assoc 10 (entget del)))
   ;(angle
   ;(cdr (assoc 10 (entget del)))
   ;(cdr (assoc 10 plist)))
   ;(* 2 (distance (cdr (assoc 10 plist))
   ;(cdr (assoc 10 (entget del)))))))
   ;(command "offset" dist poly int "")
   ;(entdel del)
   (setq i (1+ i))
 )
 (command "undo" "end")
 (if (= "Y"
 (strcase (getstring "\ndelete initial polylines? (Y/N)"))
     )
   (command "erase" plines "")
 )
)

Link to comment
Share on other sites

  • 4 months later...

This works nice, but the only problem I saw is that it does not trim the lines like offsetting a polyline does automatically. I'd like to be able to select multiple lines, offset them all inward at a specified distance, and have them trimmed automatically. The result could be one polyline or multiple lines, I don't care.

 

I could snap to the current lines, make a new polyline and offset it. Or offset each line and do a 0 degree fillet on all the corners. Unfortunately this process has to be done thousands of times so any step savers would be great.

 

Any ideas?

Link to comment
Share on other sites

  • 9 months later...
  • 6 months later...

hi all, great lisp command, is there anyway of adding into that command to be able to get the offset to go to current layer, i have this function for single offsets but would be great for multi object offsets, thanks

Link to comment
Share on other sites

  • 9 months later...

Thanks CAB, it works great for offsetIN, but offsetOUT, I can't choose the current layer to offset, could you please help me with this.

 

Best Regards,

Link to comment
Share on other sites

Did the multi line filleting get added ?

 

it can be quite easily done for any amount of lines must though have an equal number on both sides but offset distances can be anything just draw a line over the first group and 2nd line continue over other group.

 

You can then create two lists of points which are used with the fillet command.

 

If you need more info let me know.

Link to comment
Share on other sites

Thanks Bigal, the lsp works great for offsetin, but the offsetOUT wont go to the current layer.

 

Code:

;| OFFSET POLYLINES

mfuccaro@hotmail.com September 2003

Clean up by CAB 09.24.08

added curent layer for new objects

made minor adjustments here & there :)

CAB 09.27.08

Removed the Change command & added entmod

Revised the YesNo code

|;

(defun c:OffsetIN (/ plines ; selection set of polylines

ext ; extrnal point

dist ; distance to offset

poly ; a polyline from plines

plist ; the list of poly

del ; polyline to delete

int ; internal point

i

)

(command "_.undo" "_begin")

(princ "\nSelect polylines")

(setq plines (ssget)

i 0

ext (getvar "limmax")

dist (getdist "\nEnter Distance: ")

)

(repeat (sslength plines)

(setq poly (ssname plines i))

(setq plist (entget poly))

(command "_.offset" dist poly "_non" ext "")

(setq del (entlast)

int (polar

(cdr (assoc 10 plist))

(angle

(cdr (assoc 10 (entget del)))

(cdr (assoc 10 plist))

)

(* 0.1 ; CAB

(distance (cdr (assoc 10 plist))

(cdr (assoc 10 (entget del)))

)

)

)

)

(command "_.offset" dist poly "_non" int "")

(if (equal del (entlast))

(princ "\n** Error-Offset too small.")

(progn

(setq elst (entget(entlast)))

(entmod (subst (cons 8 (getvar 'clayer)) (assoc 8 elst) elst))

)

)

(entdel del)

(setq i (1+ i))

)

(command "_.undo" "_end")

(initget "Yes No")

(if (= "Yes" (getkword "\nDelete initial polylines? (Y/N) "))

(command "_.erase" plines "")

)

(princ)

)

 

 

(defun c:OffsetOUT (/ plines ; selection set of polylines

ext ; extrnal point

dist ; distance to offset

poly ; a polyline from plines

plist ; the list of poly

del ; polyline to delete

int ; internal point

i

)

(command "._undo" "_begin")

(princ "\nSelect polylines")

(setq plines (ssget)

i 0

ext (getvar "limmax")

dist (getdist "\nEnter Distance: ")

)

(repeat (sslength plines)

(setq poly (ssname plines i))

(setq plist (entget poly))

(command "_.offset" dist poly "_non" ext "")

(entmod (subst (cons 8 (getvar 'clayer)) (assoc 8 elst) elst))

(setq i (1+ i))

)

(command "_.undo" "_end")

(initget "Yes No")

(if (= "Yes" (getkword "\nDelete initial polylines? (Y/N) "))

(command "_.erase" plines "")

)

(princ)

)

Link to comment
Share on other sites

  • 1 month later...

I got autocad 2006 and the lsp works only in offesting out. There is no way I tried the offsetIN to work, and I tried different ones!! Is it a problem of 2006 version???

Link to comment
Share on other sites

  • 1 year later...

I love the POF lisp you wrote. i was wndering if there is a way for you to add two things to it? 1. remember the last distance 2. offset the line to the current layer?

Link to comment
Share on other sites

  • 3 years later...

Ok I know this is and old thread but anyways fuccaro thanks many, I think I fall in love... If you spend 5 minutes working with this lsp you will understand that it works perfect, in, out, current... etc...

Edited by Ufolocoperez
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...