Jump to content

Help - Window Selection 3D Autocad


Recommended Posts

Posted (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 by barristann
Posted

is this a command or custome lisp? only thing i find is acommand for cadworx.

Posted (edited)

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
Posted (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 by mhupp
  • Like 1
Posted

I'll try this at work. Thank you mhupp.

Posted

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

 

Posted (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)


)

 

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
Posted

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.

Posted

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
Posted
6 hours ago, barristann said:

It's okay, I'll learn to live with it.

 

life's mantra unfortunately.

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...