SELFCAD Posted February 1, 2012 Share Posted February 1, 2012 Hi guys, I have a list with point's coordinates, i want to draw a spline through these points, which is the best way? (or which is the way ? Thanks! Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 1, 2012 Share Posted February 1, 2012 I would recommend the AddSpline method, using entmake with Splines can be very complex. Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 1, 2012 Author Share Posted February 1, 2012 Maybe you have a lisp with this method? A sample... Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 2, 2012 Author Share Posted February 2, 2012 I found this code by google. Seems to replace y with z and z with y for every fit point of a spline. Why? (setq a (entget (car (entsel "\nSelect SPLine: ")))) (foreach b a (if (= (car b) 11) (setq Pdata (append Pdata (list (cdr b)) ) ) ) ) Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2012 Share Posted February 2, 2012 (edited) I'm afraid that that excerpt of code that not replace anything; it only gather all fit points to a list. Regards, Mircea Edited February 2, 2012 by MSasu Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 2, 2012 Author Share Posted February 2, 2012 Sorry, my mistake, something wrong with ucs....sorry! Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 2, 2012 Share Posted February 2, 2012 Not sure what your excerpt of code had to do with the UCS - please keep in mind that the points in associated lists are kept in WCS coordinates. By the way, even if the solutions suggested by Lee Mac are far better, a easy way to draw a spline entity from a list of points is: (command "_SPLINE") ;start the command (foreach thePoint MyPointsList ;parse points list (command thePoint) ) (command "" "" "") ;accept default tangents & end the command Regards, Mircea Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 3, 2012 Author Share Posted February 3, 2012 Thanks Mircea! Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 3, 2012 Share Posted February 3, 2012 You're welcome! Did you managed to integrate in your code the given example? Regards, Mircea Quote Link to comment Share on other sites More sharing options...
Stefan BMR Posted February 3, 2012 Share Posted February 3, 2012 The entmake way, for a list of points lst: (entmake (append (list '(0 . "SPLINE") '(100 . "AcDbEntity") '(100 . "AcDbSpline") '(70 . 40) '(71 . 3) (cons 74 (length lst)) '(44 . 1.0e-005) ) (mapcar '(lambda (x) (cons 11 x)) lst) ) ) Same result as (command "Spline" ... Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 3, 2012 Author Share Posted February 3, 2012 Perfect! Thanks, Stefan! I did it, Mircea. Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 3, 2012 Author Share Posted February 3, 2012 if i have a list with points, Pdata, p - a point from Pdata, a fix point px - not from Pdata, and a given value for Distance - let's say 10, can i set a point pd in this way? (if (and (/= (member p Pdata) nil) (= (Distance p px) 10)) (setq pd p)) Quote Link to comment Share on other sites More sharing options...
MSasu Posted February 3, 2012 Share Posted February 3, 2012 So you want to retain a point if he matches simultaneously two conditions: (1) belong to list Pdata and is located at exactly 10 units of a given point px? If true, your code is OK - have made a small correction: (if (and (member p Pdata) (= (Distance p px) 10)) (setq pd p) ) You may test your code parts (unit testing) on Console window of VLisp editor. Regards, Mircea Quote Link to comment Share on other sites More sharing options...
SELFCAD Posted February 3, 2012 Author Share Posted February 3, 2012 How can i remove the first element from a selection set? i have: (setq ss (ssget '((0 . "point")))) and i want to set now something like this: (setq ss1 (cdr ss)) - this is not possible, but how to do it? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted February 3, 2012 Share Posted February 3, 2012 (ssdel (ssname ss 0) ss) 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.