Jump to content

i search for offset with same value and opposite direction


wrha

Recommended Posts

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

Link to comment
Share on other sites

  • Replies 27
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    10

  • wrha

    6

  • alanjt

    2

  • ksavoie

    2

Top Posters In This Topic

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

(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)
)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

What I Need Trim Space Between New Offset

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • 3 months later...

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

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