PDA

View Full Version : Scr or Lsp for User Input?


ameador
2009-08-07, 04:22 PM
I am attempting to make a script to break lines at a specific distance.

_break
int
f
@-3,0
@6,0



(there is an enter at the end of the code to finish out the script)

However, I need the user to select the intersection of the lines and whichever one is highlighted is the one that gets broken.

Needless to say...I'm curious...do I need to use a lisp instead of a script in order to retrieve user input (aka select the intersection)?

I am working in ABS2007, but these are just strictly lines and/or plines.

(wonder if i placed this in the right thread location...my apologies if this is the wrong location.)

ameador
2009-08-07, 05:13 PM
Ok, so if I try to create a lisp routine of this, how do I get the user to input the intersection point?

Here's what I have so far, but it doesn't work...

(command "_break")
;;(setq el (entlast)) ;; I don't know how to use this, but it looked promising
;;(setq pt (command "int")) ;; I don't know how to use this, but it looked promising
(command "int")
(command "f")
(command "@-3,0")
(command "@6,0")

RobertB
2009-08-07, 05:26 PM
You should make the user pick the intersection. Instead, have them pick the two lines in the correct order, e.g. lower pipe, upper pipe, and use the entity information to get the intersection point(s).

ameador
2009-08-07, 06:04 PM
Hmm...What if they are plines and they intersect more than once?

I'm not sure how to do what you are suggesting, but it sounds like a very valid idea.
As you mentioned in my other post, I will go look at the AutoLisp forum...I had almost forgotten we had one! :)

Wonder if I should post this in there instead?

RobertB
2009-08-07, 06:27 PM
...
As you mentioned in my other post, I will go look at the AutoLisp forum...I had almost forgotten we had one! :)

Wonder if I should post this in there instead?I've taken the liberty of moving the thread to the AutoLISP forum. ;)

ameador
2009-08-07, 06:29 PM
Excellent.

Thank you :)