Jump to content

Help - Window Selection 3D Autocad


barristann

Recommended Posts

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 by barristann
Link to comment
Share on other sites

Hi mhupp, it's a "CADWorx Plant I" command. I'm not sure if it's custom or not. This is how it looksimage.png.32350e5c4c51123bf0fc823e86b61bac.pngimage.png.c9935ffe55242214261914d8d55b3b45.png

Edited by barristann
Link to comment
Share on other sites

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 by mhupp
  • Like 1
Link to comment
Share on other sites

Hi mhupp. I tried

 

(defun C:CurSP (/ size ss)
  (if (setq ss (ssget))
    (command "_.comp2sizespec" ss "") ; see if all at onece works
  )
)

 

image.thumb.png.fa65160d4323d75a0863d775ace2aba1.png

 

Link to comment
Share on other sites

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)


)

 

image.png.25017905a9edc2654cc410f369e5d923.png

 

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 by barristann
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...