Jump to content

vla-Offset directions


Recommended Posts

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 comment
Share on other sites

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)

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



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

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