Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Anonymous
2609 Vistas, 5 Respuestas

Autocad Quick Select shortcut

Good afternoon. Is it possible to create a shortcut with a certain autocomplete in the Quick Select command? For example, a shortcut that selects all lines with a 45 ° angle. Thank you.

Muhammed.OPERA
en respuesta a: Anonymous

Hi @Anonymous

you can select the options like the pic.

Untitled.png

 

 

 


Muhammed Mamdouh (OPERA)
Structural Engineer, Instructor
Facebook |LinkedIn

EESignature

Anonymous
en respuesta a: Muhammed.OPERA

Hello. Thank you for your attention. I know how to work with Quick Select. My question is whether there is a way to create a shortcut that does this automatically.

pendean
en respuesta a: Anonymous

You will need to move away from that pop-up command and automate with LISP: ask in the LISP forum for guidance https://forums.autodesk.com/t5/autocad-customization/ct-p/AutoCADTopic1
Muhammed.OPERA
en respuesta a: Anonymous

Hi @Anonymous 

Sorry i misunderstand-ed  you .

You can Use Lisp and AutoLisp files as @pendean said.

Look for the function of selection in LISP guide "SSget" and some other AutoLISP functions to filter your selection in AutoLISP and Visual LISP Guide. (VL-Functions).

 


Muhammed Mamdouh (OPERA)
Structural Engineer, Instructor
Facebook |LinkedIn

EESignature

tramber
en respuesta a: Muhammed.OPERA

Well, the angle of a line has to be tested after the ssget has done its job.

I would have suggested to use FILTER instead of the Quickselection thing but the angle is not present as a criteria.

And, unfortunatly too, FILTER is not scriptable.

It brings us to lisp.

 

(defun c:sang45(/ sel selout cont)
  (sssetfirst nil)
  (setq sel(ssget '((0 . "LINE")))
    selout(ssadd)
    cont 0)
  (repeat(sslength sel)
    (setq line(ssname sel cont))
    (if(member(angle(cdr(assoc 10(entget line)))(cdr(assoc 11(entget line))))
          (list (/ pi 4)(* 5(/ pi 4))))
      (setq selout(ssadd line selout)))
    (setq cont (1+ cont))
    )
  (sssetfirst nil selout)
  (princ)
  )

Just type sang45

 (modified)