Jhun Gonzalo Posted July 1, 2009 Posted July 1, 2009 Hi all, Please to help me to provide a multi-offset Lsp route, this route will select 1 or 2 lines and then pick the reference point other side of the line/pline or pick on mid between selected 2 lines then offset by 50mm, and it automatically change the line to hidden, see attached image what would be look like, Many thanks to all, Quote
Lee Mac Posted July 1, 2009 Posted July 1, 2009 I tried a different approach (defun c:off (/ lt off ln1 ln2 pt Objlst) (vl-load-com) (setq lt "HIDDEN") ;; <<--- Destination Linetype (setq off 50.) ;; <<--- Offset (setq objlst '()) (if (and (setq ln1 (car (entsel "\nSelect line 1: "))) (setq ln2 (car (entsel "\nSelect line 2: "))) (vl-every (function (lambda (x) (vl-position x '("LINE" "LWPOLYLINE" "POLYLINE")))) (mapcar (function (lambda (x) (cdr (assoc 0 (entget x))))) (list ln1 ln2))) (setq pt (getpoint "\nSelect Reference Point: ")) [color=Red][b](setq pt (trans pt 1 0)))[/b][/color] (foreach Obj (mapcar 'vlax-ename->vla-object (list ln1 ln2)) (repeat 2 (setq Objlst (append (vlax-safearray->list (vlax-variant-value (vla-offset Obj (setq off (* off -1.))))) Objlst))) (mapcar (function (lambda (x) (vla-put-linetype x lt))) Objlst) (vla-delete (car (vl-sort Objlst (function (lambda (x y) (< (distance pt (vlax-curve-getClosestPointto x pt)) (distance pt (vlax-curve-getClosestPointto y pt)))))))) (setq Objlst '()))) (princ)) Quote
Jhun Gonzalo Posted July 1, 2009 Author Posted July 1, 2009 Thanks Lee, Very fast creating codes:lol: only one thing i have a problem on UCS, i'm trying to modify and add a TRANS code but it does'nt work, Quote
Lee Mac Posted July 1, 2009 Posted July 1, 2009 See the code above, I have updated it hopefully to include UCS compatibility... 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.