BIGAL Posted August 9 Posted August 9 This seems to work but only for the scenario provided, needs a extra check for direction is left/right. Will need some more work, think of it as proof of concept. When asked to pick a line, pick near end to move. ; https://www.cadtutor.net/forum/topic/89269-extend-polyline-up-to-specific-distance-by-selecting-specific-block/ ; By AlanH Aug 2024 (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq ans (AH:getvalsm (list "Enter values " "Hor offset " 5 4 "500" "Ver offset " 5 4 "1200" ))) (setq h (atof ( car ans)) v (atof (cadr ans))) (setq obj1 (vlax-ename->vla-object (car (entsel "\nSelect a block ")))) (setq pt (vlax-get obj1 'insertionpoint)) (setq ptx (car pt) pty (cadr pt)) (setq ent (entsel "\nSelect Horizontal line ")) (setq obj2 (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj2)) (setq end (vlax-curve-getEndPoint obj2)) (setq pt3 (cadr ent)) (setq d1 (distance pt3 end)) (setq d2 (distance pt3 start)) (if (< d1 d2) (setq swap "yes") ) (setq pt2 (list (+ h ptx) (cadr end))) (if (= swap "yes") (vlax-put obj2 'endpoint pt2) (vlax-put obj2 'startpoint pt2) ) (setq ent (entsel "\nSelect Vertical line ")) (setq obj2 (vlax-ename->vla-object (car ent))) (setq start (vlax-curve-getstartPoint obj2)) (setq end (vlax-curve-getEndPoint obj2)) (setq pt3 (cadr ent)) (setq d1 (distance pt3 end)) (setq d2 (distance pt3 start)) (if (< d1 d2) (setq swap "yes") ) (setq pt2 (list (car end)(- pty v))) (if (= swap "yes") (vlax-put obj2 'endpoint pt2) (vlax-put obj2 'startpoint pt2) ) Added to my to do list to take into account directions. Multi GETVALS.lsp Quote
rpsalvi Posted August 9 Author Posted August 9 actually this circle is pile and i want to extend poly line 500 mm on right and left side of pile & 2750 mm in bottom side of pile Quote
BIGAL Posted August 9 Posted August 9 I did what you showed in image, not sure about "500 mm on right and left side of pile" please post another image or dwg, zoom in a bit please for image. Quote
rpsalvi Posted August 13 Author Posted August 13 PLEASE FIND HERE WITH ATTACHED CAD FILE FOR MY ISSUE SAMPLE.dwg Quote
BIGAL Posted August 14 Posted August 14 Again I did what you showed in image Just save multi getvals in support path or add full path to (Load "Multi getvals") Quote
rpsalvi Posted August 16 Author Posted August 16 On 8/14/2024 at 2:55 PM, BIGAL said: multi getvals CAN U HELP ME TO LOAD THIS LISP FILE? Quote
Kvlar Posted August 16 Posted August 16 3 hours ago, rpsalvi said: CAN U HELP ME TO LOAD THIS LISP FILE? can you stop typing with "capslock" ? for some countries typing with "capslock" means shouting. I don't think it's ethical to ask for help by screaming Quote
BIGAL Posted August 17 Posted August 17 Copy and paste the code above into notepad, than save as a lisp file, ie .lsp. The multi getvals is demand loaded so it must be in a location that can be found, easiest way is edit this line in the code. Put in where you have saved the file make sure to use "\\" like example it can be a single or multiple directories deep. (if (not AH:getvalsm)(load "C:\\mydirectory\\where i saved\\Multi Getvals.lsp")) 1 Quote
rpsalvi Posted August 17 Author Posted August 17 Extremely sorry for that "capslock" typing. I don't know about that things. 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.