barristann Posted January 11, 2023 Posted January 11, 2023 (edited) Hi all, the below command will prompt to Left Click a single Pipe. Is it possible to change it to use Window Selection instead of Left Click Selection? (defun C:CurSP () (command "_.comp2sizespec") ) I've tried this but doesn't work: (vl-load-com) (defun C:CurSP(/ ss) (if (setq ss (ssget)) (vla-sendcommand (vla-get-activedocument (vlax-get-acad-object)) "-comp2sizespec") ) ) Edited January 11, 2023 by barristann Quote
mhupp Posted January 11, 2023 Posted January 11, 2023 is this a command or custome lisp? only thing i find is acommand for cadworx. Quote
barristann Posted January 11, 2023 Author Posted January 11, 2023 (edited) Hi mhupp, it's a "CADWorx Plant I" command. I'm not sure if it's custom or not. This is how it looks Edited January 11, 2023 by barristann Quote
mhupp Posted January 11, 2023 Posted January 11, 2023 (edited) If the command itself is only allowing you to pick one entity at a time. Than the only option might be to make a window selection but then feed them one at a time to the command. see if this works. (defun C:CurSP (/ size ss) (setq size (getstring "\nSize: ")) (if (setq ss (ssget)) (foreach ent (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))) (command "_.comp2sizespec" ent "" size) ) ) ) (defun C:CurSP (/ size ss) (if (setq ss (ssget)) (command "_.comp2sizespec" ss "") ; see if all at onece works ) ) Edited January 11, 2023 by mhupp 1 Quote
barristann Posted January 11, 2023 Author Posted January 11, 2023 I'll try this at work. Thank you mhupp. Quote
barristann Posted January 12, 2023 Author Posted January 12, 2023 Hi mhupp. I tried (defun C:CurSP (/ size ss) (if (setq ss (ssget)) (command "_.comp2sizespec" ss "") ; see if all at onece works ) ) Quote
barristann Posted January 12, 2023 Author Posted January 12, 2023 (edited) I will only select 1 entity while using the Selection Window. So, I've also tried (defun C:CurSP (/ ss) setq ss (ssget) (command "_.comp2sizespec" ss) ) Thank you for helping mhupp. I think I have no choice but to click on the entity (instead of using a window to select the entity) Edited January 12, 2023 by barristann Quote
mhupp Posted January 12, 2023 Posted January 12, 2023 Did you try the first lisp? it will still allow you to select multiple but then only run the command and select one at a time. Quote
barristann Posted January 12, 2023 Author Posted January 12, 2023 I tried the first lisp too but didn't work unfortunately. I was hoping to replace the clicking with a window but I guess the command will not allow it. It's okay, I'll learn to live with it. Thank you again mhupp. 1 Quote
mhupp Posted January 12, 2023 Posted January 12, 2023 6 hours ago, barristann said: It's okay, I'll learn to live with it. life's mantra unfortunately. 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.