aloy Posted May 13, 2013 Posted May 13, 2013 Is it possible to assign a variable to the number returned by a selection Window or Box?. If so how. Thanking in advance. Aloy Quote
Tharwat Posted May 13, 2013 Posted May 13, 2013 That is simple but I don't want to post a sample unless I know more details about your aim of the code Quote
aloy Posted May 14, 2013 Author Posted May 14, 2013 Hi Tharvat, I am attempting triangulation. The idea is to tie the numer of points within a box or window to a variable (not selection set). If the number is greater than 9 then do something. I understand triangulation is still a hot topic in some quaters. Regards, Aloy Quote
Tharwat Posted May 14, 2013 Posted May 14, 2013 Hi Aloy . First you wrote my name in a wrong way . Second , I hope this is what you are after . (if (and (setq ss (ssget )) (eq 9 (sslength ss)) ) (do something here ....) (otherwise nil or a message to user ...) ) Quote
aloy Posted May 14, 2013 Author Posted May 14, 2013 Hi Tharwat, sorry about the mispelling. Hope it has not given any unpleasent meaning. I will try it tomarrow morning and let you know what exactly I did. Regards, Aloy Quote
aloy Posted May 15, 2013 Author Posted May 15, 2013 Tharwat, Where to put the selection window or box?. Quote
Tharwat Posted May 15, 2013 Posted May 15, 2013 Tharwat, Where to put the selection window or box?. Huh ? Quote
aloy Posted May 18, 2013 Author Posted May 18, 2013 Hi Tharwat, No worry, I will get it. Perhaps AfraLISP entities is the answer. Sometime I wonder whether this is the right forum to get any meaningful help. Regards, Aloy Quote
irneb Posted May 20, 2013 Posted May 20, 2013 What are you after? If you want to check how many objects are in a specific area of the drawing - then you could send the selection area to the ssget function in Tharwat's code. See the help on ssget for further options: http://docs.autodesk.com/ACD/2013/ENU/index.html?url=files/GUID-0F37CC5E-1559-4011-B8CF-A3BA0973B2C3.htm,topicNumber=d30e629714 Quote
pBe Posted May 20, 2013 Posted May 20, 2013 Sometime I wonder whether this is the right forum to get any meaningful help. , that is just wrong. What are you after? 1+ Quote
BIGAL Posted May 22, 2013 Posted May 22, 2013 Dont re-invent the wheel triangulation routines are out there in Lisp etc. Quote
SLW210 Posted May 22, 2013 Posted May 22, 2013 Sometime I wonder whether this is the right forum to get any meaningful help. The way a process works: input>process>output, so as you can see, the output is controlled by the input. If you want meaningful help, provide meaningful input. Quote
dbroada Posted May 22, 2013 Posted May 22, 2013 I think for the first time ever, I have looked for the "Like" button. Quote
aloy Posted May 25, 2013 Author Posted May 25, 2013 Thanks irneb, Unfortunately the link by adesk does not give the answer I am looking for. Let me put my question again in a different way: There are a large number of points in model space (theser can be couple of thousands). I want to use a selection window by lisp and tie up the number of points (only the number count) to a variable to be used later. If I give a window in response to (ssget) manually, a number will be returned and that cannot be tied to a variable as far as I can see. If I try (ssget "_W" '(0 0) '(30 20)) I will get , which is not what I want . To my mind Acad is not geared to process such an input. Am I correct?. Quote
irneb Posted May 25, 2013 Posted May 25, 2013 Thanks irneb,Unfortunately the link by adesk does not give the answer I am looking for. Let me put my question again in a different way: There are a large number of points in model space (theser can be couple of thousands). I want to use a selection window by lisp and tie up the number of points (only the number count) to a variable to be used later. If I give a window in response to (ssget) manually, a number will be returned and that cannot be tied to a variable as far as I can see. If I try (ssget "_W" '(0 0) '(30 20)) I will get , which is not what I want . To my mind Acad is not geared to process such an input. Am I correct?. As Tharwat's code does (and pBe's line) the ssget returns a selection set collection of all the entities which re selected. To get the number of entities use sslength on that selection set. Also, as pBe's shown - you can use a window selection and send the XY coordinates to ssget so you don't need to manually pick the window. If your "box" is 3d you might want to try using selection filters. In that help there is a link to how filters work. You'd need to use some logical groupings to check the "points's" dxf code 10 to ensure they're inside a specific 3d cube. Otherwise you can step through the selection set one item at a time and extract only those which are inside the box - through lisp code. The former method would work quicker though. Quote
aloy Posted May 25, 2013 Author Posted May 25, 2013 Bigal, Thanks for giving me a link earlier for triangulation, but they want $75 for each user in the office. I am on this journey as a hobby, though I have used codes written in lisp by myself for design of roads as far back as 1992. I stopped after three roads were designed and constructed I have started again just last year. Let me know which languages are used for implementation of TIN surfaces and alignments in Civil 3D. Is it not half string based modelling? . Regards, Aloy Quote
aloy Posted May 25, 2013 Author Posted May 25, 2013 SLW210, I posted some codes on Delaunay triangulation done by someone else which works well and draw vectors, but when I changed the vectors to lines it did not work. Up to 40 people had downloaded the files but I did not get a single reply to date. When I did the above posting only Tharwat replied but that too did not give a satisfactory answer. That prompted me to say what is quoted by you. I now have got satisfactory replies and I am sorry if I have hurt anybody's feelings in this forum. Regards, Aloy Quote
SLW210 Posted June 3, 2013 Posted June 3, 2013 No problem, just letting you know if you are getting non-useful responses, then your question is not clear. As you did, more explanation was needed. 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.