drafting_man Posted May 14, 2010 Share Posted May 14, 2010 hi guyes i wish anybody can help me i'm searching for lisp make spline at the end point of lines that i selected . Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 14, 2010 Share Posted May 14, 2010 I don't understand the question. Make a spline at the end point of a line? Do you mean create a spline between the endpoints of two or more lines? Quote Link to comment Share on other sites More sharing options...
drafting_man Posted May 14, 2010 Author Share Posted May 14, 2010 firest thank's mr remark for your reply what i mean i have many lines and i want to create spline from the end point of each line like this image Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 14, 2010 Share Posted May 14, 2010 I don't know of a lisp routine that will do what you want. My advice would be to do an Internet search for lisp routines that involve splines. Example: "autocad"+"lisp"+"spline" I know that Cadalyst magazine has a section of their website called Cad Tips where various CAD users have posted their own lisp routines. There are other websites that also post custom lisp routines. We have a handful of people here who also have created custom routines for themselves and at the request of other forum members. Perhaps one of them will see your thread and respond in due time. Remember, we all volunteer our time and expertise so please be patient. Sometimes an answer does not come as quickly as we may want. OK? Quote Link to comment Share on other sites More sharing options...
drafting_man Posted May 15, 2010 Author Share Posted May 15, 2010 mr remark thank's for advice i'm waiting for someone to help Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 15, 2010 Share Posted May 15, 2010 I see you did not get any further responses. Did you find anything on the Internet? Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 15, 2010 Share Posted May 15, 2010 Fun quickie, now back to watching He-Man with my little girl... (defun c:SPLC (/ ss lst) ;; Spline Connect ;; Alan J. Thompson, 05.15.10 (vl-load-com) (if (setq ss (ssget '((0 . "LINE")))) (progn (vl-cmdf "_.spline") (foreach p (vl-sort ((lambda (i) (while (setq e (ssname ss (setq i (1+ i)))) (setq lst (cons (car (vl-sort (list (vlax-curve-getStartPoint e) (vlax-curve-getEndPoint e)) (function (lambda (a b) (> (cadr a) (cadr b)))) ) ) lst ) ) ) ) -1 ) (function (lambda (a b) (< (car a) (car b)))) ) (vl-cmdf "_non" [color=Red](trans p 0 1)[/color]) ) (vl-cmdf "" "" "") ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
asos2000 Posted May 15, 2010 Share Posted May 15, 2010 alanjt Thanks Quote Link to comment Share on other sites More sharing options...
ReMark Posted May 15, 2010 Share Posted May 15, 2010 Ask...and ye shall receive. Where else can you get service like this? You know what it is don't you? Priceless. Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 15, 2010 Share Posted May 15, 2010 Code updated to account for non-WCS (completely forgot). alanjt Thanks You're welcome. Enjoy. Ask...and ye shall receive. Where else can you get service like this? You know what it is don't you? Priceless. Quote Link to comment Share on other sites More sharing options...
drafting_man Posted May 15, 2010 Author Share Posted May 15, 2010 wow alanjt u did it that what i want than;'s man u are genius Quote Link to comment Share on other sites More sharing options...
asos2000 Posted May 15, 2010 Share Posted May 15, 2010 alanjt Thanks for update in this case there is a request to keep the origen and post the update in a new post. Thats for the beginner (same as me) to learn how to avoid the commets. Thanks again Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 15, 2010 Share Posted May 15, 2010 wow alanjt u did it that what i want than;'s man u are genius You're welcome and enjoy. alanjtThanks for update in this case there is a request to keep the origen and post the update in a new post. Thats for the beginner (same as me) to learn how to avoid the commets. Thanks again Good point. I marked the updated portion in red. Trans information: trans(trans pt from to [disp]) Arguments pt A list of three reals that can be interpreted as either a 3D point or a 3D displacement (vector). from An integer code, entity name, or 3D extrusion vector identifying the coordinate system in which pt is expressed. The integer code can be one of the following: 0 World (WCS) 1 User (current UCS) 2 If used with code 0 or 1, this indicates the Display Coordinate System (DCS) of the current viewport. When used with code 3, it indicates the DCS of the current model space viewport. 3 Paper space DCS (used only with code 2) to An integer code, entity name, or 3D extrusion vector identifying the coordinate system of the returned point. See the from argument for a list of valid integer codes. disp If present and is not nil, this argument specifies that pt is to be treated as a 3D displacement rather than as a point. If you use an entity name for the from or to arguments, it must be passed in the format returned by the entnext, entlast, entsel, nentsel, and ssname functions. This format lets you translate a point to and from the Object Coordinate System (OCS) of a particular object. (For some objects, the OCS is equivalent to the WCS; for these objects, conversion between OCS and WCS is a null operation.) A 3D extrusion vector (a list of three reals) is another method of converting to and from an object’s OCS. However, this does not work for those objects whose OCS is equivalent to the WCS. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted May 16, 2010 Share Posted May 16, 2010 Is the update (vl-cmdf "_non"(trans p 0 1)) insteat of (vl-cmdf "_non" p) Isnt it What I am thinking about is? ;(vl-cmdf "_non" p) for non UCS (vl-cmdf "_non" (trans p 0 1)) ;update The deference between the 2 versions is clear. Quote Link to comment Share on other sites More sharing options...
alanjt Posted May 16, 2010 Share Posted May 16, 2010 Correct, the only change. Since I was using command for spline, I had to convert the points return with vlax-curve-* from wcs to ucs. Quote Link to comment Share on other sites More sharing options...
asos2000 Posted May 16, 2010 Share Posted May 16, 2010 alanjt not only the change but post whole code again and remark the change with deference color or copy the same line and add ; next to the line for example this is a part of the first post ) ) -1 ) (function (lambda (a b) (< (car a) (car b)))) ) (vl-cmdf "_non" p) ) (vl-cmdf "" "" "") ) and for second post (or updated) ) ) -1 ) (function (lambda (a b) (< (car a) (car b)))) ) (vl-cmdf "_non" [color=red](trans p 0 1)[/color]) ) (vl-cmdf "" "" "") ) Quote Link to comment Share on other sites More sharing options...
asos2000 Posted May 16, 2010 Share Posted May 16, 2010 or ) ) -1 ) (function (lambda (a b) (< (car a) (car b)))) ) ;(vl-cmdf "_non" p) (vl-cmdf "_non" [color=red](trans p 0 1)[/color]) ; updated to avoid UCS ) (vl-cmdf "" "" "") ) Quote Link to comment Share on other sites More sharing options...
rkmcswain Posted April 25, 2016 Share Posted April 25, 2016 Fun quickie, now back to watching He-Man with my little girl... ...and stolen I mean copied here. Quote Link to comment Share on other sites More sharing options...
alanjt Posted April 26, 2016 Share Posted April 26, 2016 ...and stolen I mean copied here. lol. Cool. . Quote Link to comment Share on other sites More sharing options...
benhubel Posted April 26, 2016 Share Posted April 26, 2016 (edited) ...and stolen I mean copied here. I assume that "Greate" is an alien language that I am unfamiliar with. In the case, however, that this is English, you might want to update the post title. **Edit** Thank you for posting it, btw. These blog posts are the type of things that originally helped me get into writing LISP code. Edited April 26, 2016 by benhubel Added comment Quote Link to comment Share on other sites More sharing options...
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.