Jump to content

Recommended Posts

Posted

dear all i search for offset with same value and opposite direction

realy if i get that option it will save me more time .

thanx for all

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    10

  • wrha

    6

  • alanjt

    2

  • ksavoie

    2

Top Posters In This Topic

Posted

So you want to offset the same distance in two directions at the same time?

Posted

Try this:

 

(defun c:dOff ( / *error* of undo doc ss )
 (vl-load-com)

 (defun *error* ( msg )
   (and undo (vla-EndUndomark doc))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
  )

 (if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))
          (setq of (getdist "\nSpecify Offset Distance: ")))
   (progn
     (setq undo
       (not
         (vla-StartUndomark
           (setq doc
             (vla-get-ActiveDocument
               (vlax-get-acad-object)
             )
           )
         )
       )
     )
     
     (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))
       (mapcar
         (function
           (lambda ( o )
             (vl-catch-all-apply
               (function vla-offset) (list obj o)
             )
           )
         )
         (list of (- of))
       )
     )
     (vla-delete ss)

     (setq undo (vla-EndUndoMark doc))
   )
 )
 (princ)
)

Posted

dear mr lee

 

most thanx for ur good suport

but plz could u help me in following request

 

IF I HAVE TOW LINE LIKE IT APPEAR IN ATTACHED JPG

I NEED BREAK OPTION WITH VARIABLES VALUE

FROM CENTER OF THAT LINE

AND CREATE IN THE CUT TOW LINES

PERPENDICULAR IN BETWEEN IT

 

THANX ALOT

Posted

I'm sure that you can do a bit of trimming - we do have to work for our money sometimes.. o:)

Posted

Mr Lee

In Double Offset Lisp Can I Add Option In That Lisp To Delet The Source Line Or No

Thanx

Posted
(defun c:dOff ( / *error* of undo doc ss flg )
 (vl-load-com)

 (defun *error* ( msg )
   (and undo (vla-EndUndomark doc))
   (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
       (princ (strcat "\n** Error: " msg " **")))
   (princ)
  )

 (if (and (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))
          (setq of (getdist "\nSpecify Offset Distance: ")))
   (progn
     (initget "Yes No")
     (setq flg (eq "Yes" (getkword "\nDelete Original? [Yes/No] <No> : ")))
     
     (setq undo
       (not
         (vla-StartUndomark
           (setq doc
             (vla-get-ActiveDocument
               (vlax-get-acad-object)
             )
           )
         )
       )
     )
     
     (vlax-for obj (setq ss (vla-get-ActiveSelectionSet doc))
       (mapcar
         (function
           (lambda ( o )
             (vl-catch-all-apply
               (function vla-offset) (list obj o)
             )
           )
         )
         (list of (- of))
       )
       (and flg (vla-delete obj))
     )
     
     (vla-delete ss)

     (setq undo (vla-EndUndoMark doc))
   )
 )
 (princ)
)

Posted

Mr Lee

Thank You Very Much

Posted

Mr Lee I Have Last Thing I Need It I N That Lisp

In Option Delet Source Line I Need Cut Line Betwen New Offset Line .

Most Thanx

Posted

I don't understand what you mean. Why did you not ask that when you asked me to modify it previously?

Posted

Oh Sory Mr Lee Realy I Try To Improve That Lisp To Be Better .

What I Need Trim Space Between New Offset

Posted

Sir Lee,

i need i similar routine. i made a msg in another thread and here is the link

 

http://www.cadtutor.net/forum/showthread.php?t=47492&page=2

 

if you have spare time, can you (or anybody) modify it for me.

 

it is like this.

offset both side

delete the original pline

connect & join them to become one

and finally instead of specifying the offset distance,

distance between 2 parallel line will be specified.

 

tnx.

  • 3 months later...
Posted

hi...

this lisp lisp is realy great...

can you please do me a favor?

 

now layer option for object is "source"

can you please make it to "Current"

 

thanks

bijoy.vm

Posted

nice, as always awesome :D

why this doesn't work with RAY object?

i never used them but i'm just curious.

 

i modify this:

(ssget "_:L" '((0 . "ARC,CIRCLE,ELLIPSE,*LINE,RAY")))

but nothing

 

thanks

Posted (edited)

Thanks Kruuger,

>> why this doesn't work with RAY object?

 

Because the Ray object doesn't have an Offset method

 

Here is another version of the above, more akin to the normal offset command:

DoubleOffset V1-1.lsp

Edited by Lee Mac
Posted
FYI Lee, you cannot offset a 3DPolyline.

 

Thanks Alan, I'll see to the code :)

Posted
Thanks Alan, I'll see to the code :)

No problem. I just thought I'd give it a look. I was actually curious what was so different that you aren't just suggesting your Dynamic Offset routine.

Posted
No problem. I just thought I'd give it a look. I was actually curious what was so different that you aren't just suggesting your Dynamic Offset routine.

 

I've averted from 'dynamic' programs - too much hassle for minimal practicality... (I've finally seen the light) - I suppose that's what you get from actually working in a DO for a period...

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...