Message 1 of 17
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
lisp senario attached in images
Solved! Go to Solution.
lisp senario attached in images
Solved! Go to Solution.
(defun c:Lines (/ pnt tmp sds ds1 ds2 fc1 fc2) (while (setq pnt (getpoint "\nSpecify a Core point <done>: ")) (setq tmp (getpoint "\nPick a side: " pnt) sds (if (> (- (cadr tmp) (cadr pnt)) 0) '("RIGHT" "LEFT") '("LEFT" "RIGHT" )) ds1 (getdist (strcat "Specify " (car sds) " distance: ")) fc1 (getdist (strcat "Specify " (car sds) " factor: "))) (if (setq ds2 (getdist (strcat "Specify " (last sds) " distance <equal to " (car sds) ">: "))) (setq fc1 (getdist (strcat "Specify " (last sds) " factor: "))) (setq ds2 ds1 fc2 fc1)) (vl-cmdf "_.pline" "_non" (polar pnt (if (= (last sds) "RIGHT") 0. pi) (/ ds2 fc2)) "_non" pnt "_non" (polar pnt (if (= (car sds) "RIGHT") 0. pi) (/ ds1 fc1)) "")) (princ) )
thank you so much , if you can ? can i get downloadable file , i use mobile browser , can not download lisp file .
@ВeekeeCZ wrote:
.... sds (if (> (- (cadr tmp) (cadr pnt)) 0) ....
ds1 (getdist (strcat "Specify " (car sds) " distance: ")) ....
That's comparing Y coordinates. Shouldn't it be comparing X coordinates to decide whether the temporary point is to the right or left of the core point?
sds (if (> (- (car tmp) (car pnt)) 0)
or, more simply:
sds (if (> (car tmp) (car pnt))
And I would suggest using the core point as reference base for a rubber-band line in the (getdist) functions, not only for the visual but to allow picking the distance on-screen from there if desired:
ds1 (getdist pnt (strcat "Specify " (car sds) " distance: "))
and similarly with the others.
Thanks!
Though not sure about the last one... Thinking that too many rubber bands could be rather confusing... So leaving that one up to the OP.
thank you beekeeCZ it star well but after final ENTRY SOME THING WRONG HAPPEN ,....... NEED TO REVISON PLEASE
I have no idea what that could be. You gotta give me something more... copy-paste a command-line listing, video capture... something like that.
lines was not drawen
in other forum , gentel man like you , try to help me
see this link .
https://www.cadtutor.net/forum/topic/69414-draw-left-and-right-line-segment-from-point/
can you pack lisp final tested code as lisp file and send it for me
Sorry to bother you, I really need to this lisp, as soon as possible. I have a lot of work and time is short, it is generous from you if I keep helping me
Found it.
(defun c:Lines (/ pnt tmp sd1 sd2 ds1 ds2 fc1 fc2) (while (setq pnt (getpoint "\nSpecify a Core point <done>: ")) (setq tmp (getpoint "\nPick a side: " pnt)) (if (> (car tmp) (car pnt)) (setq sd1 "RIGHT" sd2 "LEFT") (setq sd1 "LEFT" sd2 "RIGHT")) (setq ds1 (getdist (strcat "Specify " sd1 " distance: ")) fc1 (getdist (strcat "Specify " sd1 " factor: "))) (if (setq ds2 (getdist (strcat "Specify " sd2 " distance <equal to " sd1 ">: "))) (setq fc2 (getdist (strcat "Specify " sd2 " factor: "))) (setq ds2 ds1 fc2 fc1)) (vl-cmdf "_.pline" "_non" (polar pnt (if (= sd2 "RIGHT") 0. pi) (/ ds2 fc2)) "_non" pnt "_non" (polar pnt (if (= sd1 "RIGHT") 0. pi) (/ ds1 fc1)) "")) (princ) )
I am sorry again ، can you upload lisp file in link , and your lisp as downloadable *.lsp file
It works professionally ،
"but if you can make lisp add point object when start pick core point" . then upload your lisp file
I thank you first and for all who helped me.
I ask God that you will always be fine.
Perfect, you can do the other Job too now
Sebastian
@cadffm wrote:
Perfect, you can do the other Job too now
Thank you! I had that kind of feeling that this would be good... but perfect? No, it's not. But still appreciate your kind word(s).
And the other thread... no, thanks! Don't like the shape.
@abdulellah.alattab wrote:
...
"but if you can make lisp add point object when start pick core point" ...
That's simple.
(defun c:Lines (/ pnt tmp sd1 sd2 ds1 ds2 fc1 fc2) (while (setq pnt (getpoint "\nSpecify a Core point <done>: ")) (command "_.point" "_non" pnt) (setq tmp (getpoint "\nPick a side: " pnt)) ...
final lisp code attached below , thank you beeKeeCZ
HINT : the left and right segment length modified to be ( distance multiplied by factor )