Michaels Posted February 27, 2012 Posted February 27, 2012 hello . I have a riser duct as shown in the drawing , and I want to select the YELLOW lines and the offset should go one on the right and one on the left side to become the same as the RED lines . Hope this possible with lisp example.dwg Quote
ReMark Posted February 27, 2012 Posted February 27, 2012 Maybe you can benefit from forum member Lee Mac's Dynamic Offset lisp routine. Check it out at.... http://lee-mac.com/dynamicoffset.html There are several options available to the user. Quote
pBe Posted February 27, 2012 Posted February 27, 2012 hello . I have a riser duct as shown in the drawing , and I want to select the YELLOW lines and the offset should go one on the right and one on the left side to become the same as the RED lines . Hope this possible with lisp "OFFSET OBJECTS to..." Requested too many times that Autodesk ought to incldue a command on the next version called ToOffsetThisAndThatToThereOrThere command alia: TOTATATOT Anyhoo. issues i encounter writing a code for TOTATATOT function. Type of objects Direction of objects Point value for Side to offset or to supress prompt for "side to offset" Layer/Color/Ltype for the newly created entity Make use of TRUE offset or make new objects Just my 2 cents Quote
Michaels Posted February 27, 2012 Author Posted February 27, 2012 The link that given by Remark is very nice code by Lee , but it does not work in my case . pbe , I did not understand your idea , so would you please take a look at the drawing to see what I am refereeing to ? Thank you all Quote
pBe Posted February 27, 2012 Posted February 27, 2012 The link that given by Remark is very nice code by Lee , but it does not work in my case . pbe , I did not understand your idea , so would you please take a look at the drawing to see what I am refereeing to ? Thank you all I'm expressing an opinion Michaels, pay no attention to it I had look/see at your drawing. and while i'm pondering on the approach on your request those questions above kept on popping in my head. Tell me, how would you go about doing it? keeping in mind the issues i posted. How would you answer it? Quote
Michaels Posted February 27, 2012 Author Posted February 27, 2012 "OFFSET OBJECTS to..." Type of objects Direction of objects Point value for Side to offset or to supress prompt for "side to offset" Layer/Color/Ltype for the newly created entity 1- select only lines (2 numbers ) 2- the line which is on the left its offset line should go left and the one on the right should go on the right . 3- ( if you mean the distance of the offset ) it is always 50.0 4- Layer should follow the original Layer ( of lines ). Did I answer them correctly ? Thanks a lot for your interests pBe. Quote
pBe Posted February 27, 2012 Posted February 27, 2012 1. Check 2. Check 3. Check 4. Check Okay that narrows it down. Now all you need to do now is wait ... somebody will come along and write a code or point you in the right diretion. Patience Michaels Quote
pBe Posted February 29, 2012 Posted February 29, 2012 Whoa ... i'm surpirsed no one else wrote a code for you.. i'm on vacation (from cad at least). i guess what i can do is give a suggestion. (if and (setq ss (ssget "_:L"))(= (setq i (sslength ss)) 2))Get midpoint of both lines Midpoint of two points as reference to test for "side to offset", the point will be oposite to where the new lines will be. easy huh? As soon as i can get my hands on CAD i'll write one for you, but i dont see that happening anytime soon. but i'm sure someone here will get it to later. again be patient Michaels Quote
pBe Posted March 12, 2012 Posted March 12, 2012 Here's a quick one (defun c:o2 (/ _dxf ss pts rf pt1 pt2) (defun _dxf (e n) (cdr (assoc n (entget e)))) (defun _mid (p1 p2) (mapcar (function (lambda (a b) (/ (+ a b) 2.))) p1 p2)) (while (and (princ "\nSelect 2 Lines to offset") (setq ss (ssget "_:L" '((0 . "LINE")))) (= (setq i (sslength ss)) 2)) (setq pts (list (_dxf (setq 1st (ssname ss 0)) 10) (_dxf 1st 11) (_dxf (setq 2nd (ssname ss 1)) 10) (_dxf 2nd 11))) (setq rf (_mid (setq pt1 (_mid (car pts) (cadr pts))) (setq pt2 (_mid (caddr pts) (cadddr pts))))) (command "_offset" 50.0 (ssname ss 0) "_non" (polar rf (angle rf pt1) (+ (distance rf pt1) 50.0)) "") (command "_offset" 50.0 (ssname ss 1) "_non" (polar rf (angle rf pt2) (+ (distance rf pt2) 50.0)) "") ) (princ) ) I'm a bit surprised really no one else wrote a code for this just got back from vacation. Anyhoo.. try it out Michaels and tell me what you think (that is if you still need a lisp routine for your request) Quote
Lee Mac Posted March 12, 2012 Posted March 12, 2012 I'm a bit surprised really no one else wrote a code for this We're not here just to write code for people. Quote
pBe Posted March 12, 2012 Posted March 12, 2012 We're not here just to write code for people. Well that explains it... Curioulsy, nobody else jumped on this particular request even though i'm egging others to do so... like the way other forum members do in the past. ...somebody will come along and write a code or point you in the right diretion.... ...but i'm sure someone here will get it to later.... Anyhoo... i wasnt implying anything really. just horsing around. Cheers LM Quote
pBe Posted March 22, 2012 Posted March 22, 2012 Michaels, Did I just wasted my time writing the code? And then there was me thinking you were neglected. Quote
BIGAL Posted March 23, 2012 Posted March 23, 2012 Pbe easier way message "pick left hand side of line near end" then no matter what angle line is drawn at you imply which is left and right, use start,end,pick pt compare and swap start,end if required. After a few mistakes you get the hang of picking upside down for right=left. Quote
pBe Posted March 23, 2012 Posted March 23, 2012 Pbe easier way message "pick left hand side of line near end" then no matter what angle line is drawn at you imply which is left and right, use start,end,pick pt compare and swap start,end if required. After a few mistakes you get the hang of picking upside down for right=left. I had thought of that too, i was trying to avoid the overhead of swapping the points in the event the lines selected are not created with the same direction hence i used midpoint as the basis But I will take that into consideration that is if we ever get to hear anything fom the OP Cheers Bigal Quote
Michaels Posted March 24, 2012 Author Posted March 24, 2012 Michaels, Did I just wasted my time writing the code? And then there was me thinking you were neglected. Hi pBe . I am sorry for this late reply to your nice work , it is very helpful . Thank you so much , I will add it immediately to my adddoc.lsp to be a part of my daily command . Sorry again . Quote
pBe Posted March 24, 2012 Posted March 24, 2012 Hi pBe . I am sorry for this late reply to your nice work No need to apologise Michaels, just wondering if the code helped you with your problem is all. Cheers 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.