Jump to content

vla-Offset directions


CarmeloLabadie

Recommended Posts

CarmeloLabadie

I'm a little confused... I've read in all the vla-Offset posts about the difficulty in determining the direction of the offset. Have things changed for 2007? I get the following consistent results:

LINE: + to left & - to right
ARC: + increase radius & - decrease radius
LWPOLYLINE: + to right & - to left

Obviously this makes things so much easier.

Link to post
Share on other sites
Emmanuel Delay

Lines, polylines have a direction. 

You can draw a line from left to right, or from right to left.  

Just like polylines have an order of which point came first ...

 

Depending on that the offset can do the opposite thing, depending on whether the distance is positive or negative.

Test my code (type a number for getdist instead of setting two points) on the dwg I uploaded.

 

 

;; Custom OFFset
(defun c:coff ( / mspace myline dist offLine)
    (vl-load-com)

    (setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))

    (setq myline (vlax-ename->vla-object (car (entsel "\nSelect object to offset: " ))))
    (setq dist (getdist "\nOffset Distance : "))
    (setq offLine (vla-Offset myline dist))
    (princ)
    
)
(princ)

 

offset.dwg

Edited by Emmanuel Delay
  • Like 1
  • Funny 1
Link to post
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
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...