CafeJr Posted October 16, 2013 Author Posted October 16, 2013 Noop ReMark... I have many ways to do what I whant, so, sometimes I need to regroup the objects created (lines in this case)... because it I posted the new question... Quote
pBe Posted October 16, 2013 Posted October 16, 2013 (Defun c:alg (/ spep ss lcoll frx refe rf pt npt) (defun spep (e / e y1 y2) (setq y1 (vlax-curve-getStartPoint e) y2 (vlax-curve-getEndPoint e) ) (append (list e) (if (minusp (- (cadr y1) (cadr y2))) (list y2 y1) (list y1 y2) ) ) ) (if (setq lcoll nil ss (ssget '((0 . "LINE,LWPOLYLINE"))) ) (progn (setq lcoll (cons (spep (setq e (ssname ss 0))) lcoll ) Frx (caadar lcoll) refe e ) (ssdel (caar lcoll) ss) (repeat (setq i (sslength ss)) (setq lcoll (cons (spep (setq e (ssname ss (setq i (1- i))))) lcoll ) ) (if (< (setq rf (caadar lcoll)) Frx) (setq Frx rf refe (caar lcoll) ) ) ) (setq ds (getdist (setq pt (cadr (Spep refe))) "\nSpecify Distance from this point:" ) ) (setq lcoll (vl-remove (assoc refe lcoll) lcoll)) (foreach itm (vl-sort (mapcar 'reverse lcoll) '(lambda (j k) (< (caar j) (caar k))) ) (vla-move (vlax-ename->vla-object (last itm)) (vlax-3d-point (Cadr itm)) (vlax-3d-point (setq npt (polar pt 0.0 ds))) ) (setq pt npt) ) ) )(princ) )(vl-load-com) Quote
Dana W Posted October 16, 2013 Posted October 16, 2013 This is why I usually just draw the stuff I need. By the time resources for short cuts are found, the deadline or my patience, or both is exhausted. Quote
ReMark Posted October 16, 2013 Posted October 16, 2013 Well you failed to tell us what kind of drawings you create so I don't know if this is something you need to do for every job or if it is a one shot deal. Quote
CafeJr Posted October 17, 2013 Author Posted October 17, 2013 Well you failed to tell us what kind of drawings you create so I don't know if this is something you need to do for every job or if it is a one shot deal. ReMark... Sorry, I didn't tryed explain!... I wrote it twice today using mobile phone, so I don't know why it don't filled up on post!!!... Well, let me try again!... I'm working with some guys that don't know the features of AutoCad or AutoLisp... As an exemple, they use the command offset on 150 entities, but, one by one!!!... It's so cool to do it!!!... I got one code that could help them with it, doing it for all selected item as fast as system allows (cad or windows)!!!... Usually they receive from other some drawings that have a lot of objects (arcs, plines, lines) in disorder, it need to be ordened to be possible start to work... like in this case!!!... We get a mechanical drawing (circular objects - helice of wind power system) that need to be exchanged this drawing in a plan way (geting the perimeter from a circunference and drawing it as a line)... It's possible create a lot of small commands or funcions that could help us... I think that I explained!... affffff... He he he... Quote
CafeJr Posted October 17, 2013 Author Posted October 17, 2013 This is why I usually just draw the stuff I need. By the time resources for short cuts are found, the deadline or my patience, or both is exhausted. Yeahhh Dana W, I know it!... Sorry, as I told you, I didn't pay attention on my drawing, only about the issue!!!... Quote
ReMark Posted October 17, 2013 Posted October 17, 2013 Did you even look at the link I posted to Lee Mac's Dynamic Offset lisp program? Yes or no? Quote
CafeJr Posted October 17, 2013 Author Posted October 17, 2013 (Defun c:alg (/ spep ss lcoll frx refe rf pt npt) (defun spep (e / e y1 y2) (setq y1 (vlax-curve-getStartPoint e) y2 (vlax-curve-getEndPoint e) ) (append (list e) (if(minusp (- (cadr y1) (cadr y2))) (list y2 y1) (list y1 y2) ) ) ) (if (setq lcoll nil ss (ssget '((0 . "LINE,LWPOLYLINE"))) ) (progn (setq lcoll (cons (spep (setq e (ssname ss 0))) lcoll ) Frx (caadar lcoll) refe e ) (ssdel (caar lcoll) ss) (repeat (setq i (sslength ss)) (setq lcoll (cons (spep (setq e (ssname ss (setq i (1- i))))) lcoll ) ) (if (< (setq rf (caadar lcoll)) Frx) (setqFrx rf refe (caar lcoll) ) ) ) (setq ds (getdist(setq pt (cadr (Spep refe))) "\nSpecify Distance from this point:" ) ) (setq lcoll (vl-remove (assoc refe lcoll) lcoll)) (foreach itm (vl-sort (mapcar 'reverse lcoll) '(lambda (j k) (< (caar j) (caar k))) ) (vla-move (vlax-ename->vla-object (last itm)) (vlax-3d-point (Cadr itm)) (vlax-3d-point (setq npt (polar pt 0.0 ds))) ) (setq pt npt) ) ) )(princ) )(vl-load-com) pBe thaks again, it will help me!... And works perfectly!... 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.