Jump to content

Help changing this LISP routine so I can select hundreds of lines at once?


Recommended Posts

Posted

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.

Posted

Please take a look on SSGET, SSNAME, ENTGET and ASSOC function.

 

Regards,

Mircea

Posted

  • 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.

Posted
  • 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.

Posted

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.

Posted

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.

Posted
(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)
)

Posted
(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 :twisted:

Posted
Thanks a million. I may be back :twisted:
I might help.
Posted
sincerely, thank you.

You're welcome.

Posted

You might want to consider using 'data extraction'

Posted
You might want to consider using 'data extraction'

 

I did, it doesn't grab X,Y coords, unfortunately.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...