CarmeloLabadie Posted November 23, 2021 Posted November 23, 2021 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. Quote
Emmanuel Delay Posted November 23, 2021 Posted November 23, 2021 (edited) 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 November 23, 2021 by Emmanuel Delay 1 1 Quote
mhupp Posted November 23, 2021 Posted November 23, 2021 This might help http://www.theswamp.org/index.php?topic=57171.0 Quote
BIGAL Posted November 24, 2021 Posted November 24, 2021 Like mhupp answered some where else. My $0.05 I use pick near end of line pline etc this determines the direction uses a compare end points to pick point. Quote
dexus Posted November 24, 2021 Posted November 24, 2021 I have used parts of this code in the past to determine the side: https://autocadtips1.com/2011/07/04/autolisp-offset-polyline-segments/ Quote
Recommended Posts
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.