Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LISP to use QSE

2 REPLIES 2
Reply
Message 1 of 3
elias.kanellakis
281 Views, 2 Replies

LISP to use QSE

Hi everyone!

 

I 'm quite new in learning Visual Lisp and I need some help..

 

I 'd like to create a Lisp that:

 

1) Uses Quick Select to select all Hatches in a specified drawing area and delete them

2)Uses QSE to select all Lines from layer "ABC" and move them to layer "DEF"

3)Uses QSE to select any block named "EXAMPLE1" and replace it with an existing block named "EXAMPLE2"

 

Is any of that posible? I 'd really appreciate any answer! Thanx!

2 REPLIES 2
Message 2 of 3

Quick Select is as user interface that allows users to get results based on the use of AutoLISP functionality of the SSGET Function.

 

(for example to select a bunch of lines on a layer)

(setq myliness (ssget "X" '((0 . "LINE") (8 . "ABC")))))

 

To move to a different layer you could process that in so many ways. One method is just using the Command function

with the CHANGE Command

(command "change" myliness "" "p" "La" "DEF")

 

Hopefully that gives you a place to get some things started. Good luck

 

 

Message 3 of 3
james_moore
in reply to: SeeMSixty7

; defines a command HATCHDEL that should delete all hatches from a drawing, provided they are not embedded in a block. Untested, might need a tweak or two.  The point selection part isn't included, you might have to do two selection steps I think... pretty sure the point selection filter will have to be done separate from the simple "get all HATCH entities I've shown.  Look into ssget "W" and ssget "C" for the functions needed for window or crossing selection.

 

(defun C:HATCHDEL ( / STUFFTOKILL)

 (setq STUFFTOKILL (ssget "X" '((0 . "HATCH"))))

 (if STUFFTOKILL (command "ERASE" STUFFTOKILL ""))

)

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

AutoCAD Inside the Factory


Autodesk Design & Make Report