Message 1 of 11
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I found an awesome routine that allow me to offset multiple elements in a single operation, but I cannot choose the orientation for the offset...
Is it possible to edit this routine in order to be able to identify in which direction I want my offset to be done?
(defun c:mOff (/ ss tmp safe lst) (vl-load-com) (or *moff (setq *moff 10.0)) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (setq ss (ssget '((0 . "ARC,CIRCLE,ELLIPSE,*LINE")))) (progn (initget 6) (and (setq tmp (getdist (strcat "\nSpecify Offset <" (vl-princ-to-string *moff) "> : "))) (setq *moff tmp)) (vla-StartUndoMark doc) (foreach var (mapcar (function (lambda (x) (vla-offset x *moff))) (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))) (cond ((<= 0 (vlax-safearray-get-u-bound (setq safe (vlax-variant-value var)) 1)) (setq lst (cons (vlax-safearray->list safe) lst))))) (foreach Obj (setq lst (apply 'append lst)) (if (vl-some (function (lambda (x) (vlax-invoke obj 'IntersectWith x acExtendNone))) (vl-remove Obj lst)) (vla-put-color Obj acred))) (vla-EndUndoMark doc))) (princ))
Thank you for your time!
Solved! Go to Solution.