yxl030 Posted August 15, 2021 Share Posted August 15, 2021 I want to draw a line, and at the same time, make the latter part of it bend 45 degrees, so need a click to give the direction。 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 15, 2021 Share Posted August 15, 2021 (edited) As I said Have a go if stuck post. Understand what you want. Remember people who post solutions are doing so as a free service so are not under a obligation to jump straight in and provide a solution, most that do have a day job as well. If you dont understand lisp say so. Edited August 15, 2021 by BIGAL Quote Link to comment Share on other sites More sharing options...
yxl030 Posted August 16, 2021 Share Posted August 16, 2021 Thank you for your reply. I do not understand lisp except statements like “setq”, “command”. I have tried to understand and modify your program, but did not achieve my requirements. I'll try again, thanks. 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted August 17, 2021 Share Posted August 17, 2021 This is an extra to Admin maybe join. I will see if can find time to modify what I have previously provided. Quote Link to comment Share on other sites More sharing options...
yxl030 Posted August 19, 2021 Share Posted August 19, 2021 I have tried to modify BIGAL‘s Lisp,It basically meets my requirements. (defun C:45dpline ( / oldsnap pt1 pt2 pt3 pt4 pt5 dire off rad ent) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq off 180.0 rad 0.0) ; (setvar 'filletrad rad) (setq dire (getstring "\n Clockwise(Y/n): ")) (while (setq ent (entsel "\npick p/line near end Enter to exit")) ;(setq pt3 (cadr ent)) (setq obj (vlax-ename->vla-object (car ent))) (setq pt1 (vlax-curve-getStartPoint obj)) (setq pt2 (vlax-curve-getEndPoint obj)) (setq ang (angle pt1 pt2)) (setq pt4 (polar pt2 (- ang (/ pi 2.0)) off)) (setq pt5 (polar pt4 (+ ang (* pi 0.75)) off)) (if (= dire "n") (progn (setq pt4 (polar pt2 (+ ang (/ pi 2.0)) off)) (setq pt5 (polar pt4 (- ang (* pi 0.75)) off)) ) ) (command "line" pt4 pt5 "") (setq pt5 (mapcar '* (mapcar '+ pt4 pt5) '(0.5 0.5)))4 (command "fillet" ent pt5) ) (setvar 'osmode oldsnap) (princ) ) But when I click on the OFF part on the pline, it will bends like pl3,I don't understand why this happens. How to avoid this ? I hope No matter where I click to select ,it bends like pl2. Quote Link to comment Share on other sites More sharing options...
mohamed2022 Posted September 23, 2021 Share Posted September 23, 2021 THANK YOU Quote Link to comment Share on other sites More sharing options...
Abdulellah Posted February 28, 2023 Share Posted February 28, 2023 On 19/08/2021 at 11:56, yxl030 said: I have tried to modify BIGAL‘s Lisp,It basically meets my requirements. (defun C:45dpline ( / oldsnap pt1 pt2 pt3 pt4 pt5 dire off rad ent) (setq oldsnap (getvar 'osmode)) (setvar 'osmode 0) (setq off 180.0 rad 0.0) ; (setvar 'filletrad rad) (setq dire (getstring "\n Clockwise(Y/n): ")) (while (setq ent (entsel "\npick p/line near end Enter to exit")) ;(setq pt3 (cadr ent)) (setq obj (vlax-ename->vla-object (car ent))) (setq pt1 (vlax-curve-getStartPoint obj)) (setq pt2 (vlax-curve-getEndPoint obj)) (setq ang (angle pt1 pt2)) (setq pt4 (polar pt2 (- ang (/ pi 2.0)) off)) (setq pt5 (polar pt4 (+ ang (* pi 0.75)) off)) (if (= dire "n") (progn (setq pt4 (polar pt2 (+ ang (/ pi 2.0)) off)) (setq pt5 (polar pt4 (- ang (* pi 0.75)) off)) ) ) (command "line" pt4 pt5 "") (setq pt5 (mapcar '* (mapcar '+ pt4 pt5) '(0.5 0.5)))4 (command "fillet" ent pt5) ) (setvar 'osmode oldsnap) (princ) ) But when I click on the OFF part on the pline, it will bends like pl3,I don't understand why this happens. How to avoid this ? I hope No matter where I click to select ,it bends like pl2. Do not expect him to help you, of course, always incomplete and provocative solutions, compared to other professionals. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 28, 2023 Share Posted February 28, 2023 I have over 16000 posts here and respond to 4 forums occasionally I miss a request they could have sent me a private message. Sounds like I did not send an answer to you for a request. Or I did as much as I was prepared to do. I test the code before posting it and make sure it works often a user will do something not considered and it does not work. The code has been changed and not by me what I posted works for the original request. The code posted here is mostly provided free of charge, have you posted anything useful ? 1 Quote Link to comment Share on other sites More sharing options...
Steven P Posted March 1, 2023 Share Posted March 1, 2023 I wasn't sure if that was a serious comment or a joke - very odd either way. A weird post to pick particualrly when the OP and subsequent question appear to be satisfied, have a code they can use or learnt enough that they can adjust what the suggestions above gave. Quote Link to comment Share on other sites More sharing options...
ronjonp Posted March 1, 2023 Share Posted March 1, 2023 (edited) 6 hours ago, BIGAL said: I have over 16000 posts here and respond to 4 forums occasionally I miss a request they could have sent me a private message. Sounds like I did not send an answer to you for a request. Or I did as much as I was prepared to do. I test the code before posting it and make sure it works often a user will do something not considered and it does not work. The code has been changed and not by me what I posted works for the original request. The code posted here is mostly provided free of charge, have you posted anything useful ? Almost funny but too on point Quality over quantity IMO. Edited March 1, 2023 by ronjonp Quote Link to comment Share on other sites More sharing options...
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.