PlutoISaPlanet Posted April 19, 2011 Posted April 19, 2011 I'm trying to generate the X&Y coordinates for each line in a "field" exercise for school. I have hundreds of polylines and ran across this post: http://www.afralisp.net/visual-lisp/tutorials/polylines-part-1.php and it does exactly what I need to but I need to be able to select every line in my drawing and have the x-y output. Is this possible? It would be a lifesaver. Quote
MSasu Posted April 19, 2011 Posted April 19, 2011 Please take a look on SSGET, SSNAME, ENTGET and ASSOC function. Regards, Mircea Quote
alanjt Posted April 19, 2011 Posted April 19, 2011 Look at the ssget function for multiple selection. Look at while or repeat to step through the selection set (created with ssget) and ssname to extract each entity from the selection set. There are tons of code floating around here. I'd give you an example, but I'd be doing too much of your homework. Quote
PlutoISaPlanet Posted April 19, 2011 Author Posted April 19, 2011 Look at the ssget function for multiple selection. Look at while or repeat to step through the selection set (created with ssget) and ssname to extract each entity from the selection set. There are tons of code floating around here. I'd give you an example, but I'd be doing too much of your homework. Thanks but I don't know the first thing about actually getting those functions into the routine. I'm guessing you have the impression I'm in a LISP scripting class, but the assignment I mentioned is actually for my design studio where we're generating some fields rather randomly. I'm trying to be a little more systematic than the assignment calls for by putting some substance into the visualizations I'm creating. I could do this in Illustrator easily and not worry about the data-sets. What I've done so far is create the "field" in illustrator and now want to export the coordinates to bring it into visualization software and generate lines connecting every point where 5 or more of these lines intersect and shade-in every bound area of a certain size. I don't know the first thing about writing a routine, I'm just trying to tackle this from a different angle. Thanks, though. Quote
PlutoISaPlanet Posted April 19, 2011 Author Posted April 19, 2011 This specific routine is telling me my lines aren't poly lines when in fact, they are as well. They don't have to be, but I converted them as such specifically for the routine. Quote
PlutoISaPlanet Posted April 19, 2011 Author Posted April 19, 2011 If anyone could point me to a routine that could extract the x-y values of each of these lines other than this one I'd be very appreciative as well. Quote
alanjt Posted April 19, 2011 Posted April 19, 2011 (defun c:TEst (/ ss i d) (if (setq ss (ssget '((0 . "LINE")))) (repeat (setq i (sslength ss)) (print (append (cons "START:" (cdr (assoc 10 (setq d (entget (ssname ss (setq i (1- i)))))))) (cons "END: " (cdr (assoc 11 d))) ) ) ) ) (princ) ) Quote
PlutoISaPlanet Posted April 19, 2011 Author Posted April 19, 2011 (defun c:TEst (/ ss i d) (if (setq ss (ssget '((0 . "LINE")))) (repeat (setq i (sslength ss)) (print (append (cons "START:" (cdr (assoc 10 (setq d (entget (ssname ss (setq i (1- i)))))))) (cons "END: " (cdr (assoc 11 d))) ) ) ) ) (princ) ) Thanks a million. I may be back Quote
alanjt Posted April 19, 2011 Posted April 19, 2011 Thanks a million. I may be back I might help. Quote
edwinprakoso Posted April 21, 2011 Posted April 21, 2011 You might want to consider using 'data extraction' Quote
PlutoISaPlanet Posted April 21, 2011 Author Posted April 21, 2011 You might want to consider using 'data extraction' I did, it doesn't grab X,Y coords, unfortunately. Quote
fuccaro Posted April 22, 2011 Posted April 22, 2011 Maybe this could help... http://www.cadtutor.net/forum/showthread.php?1697-command-list-props It works on lines, so explode the polylines first Quote
edwinprakoso Posted April 25, 2011 Posted April 25, 2011 I did, it doesn't grab X,Y coords, unfortunately. It does actually. Have you seen this? Create a Report Table with Data Extraction 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.