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

Filtering points and dimensions

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
259 Views, 8 Replies

Filtering points and dimensions

Hello

As much i know now, that i can not make macro for that.
But any lisp people can maybe help me out.

I want to make buttons to use in filter already made list, like: _filter and from there in list menu to take "dimension" or "point". Those two i will like to filter out and erase.

Any helpful lisp will be very welcome and if you can make note, how i can change lisp if i like to use other names from the filter list.


BTW, i was trying in macro to grate that: ^C^C_filter _^I^I^I^I dim ; but why don't work tab? "dim" is the name in the list
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

The following will allow you to only select a POINT:
(ssget'((0 . "POINT")))

The following will allow you to only select a DIMENSION:
(ssget'((0 . "DIMENSION")))

The following will allow you to only select both POINTS & DIMENSIONS:
(ssget'((-4 . "")))

The following will automatically select all POINTS in current drawing:
(ssget"X"'((0 . "POINT")))

The following will automatically select all DIMENSIONS in current drawing:
(ssget"X"'((0 . "DIMENSION")))

The following will automatically select both POINTS & DIMENSIONS in current
drawing:
(ssget"X"'((-4 . "")))

Paul

wrote in message news:5780878@discussion.autodesk.com...
Hello

As much i know now, that i can not make macro for that.
But any lisp people can maybe help me out.

I want to make buttons to use in filter already made list, like: _filter and
from there in list menu to take "dimension" or "point". Those two i will
like to filter out and erase.

Any helpful lisp will be very welcome and if you can make note, how i can
change lisp if i like to use other names from the filter list.


BTW, i was trying in macro to grate that: ^C^C_filter _^I^I^I^I dim ; but
why don't work tab? "dim" is the name in the list
Message 3 of 9
Anonymous
in reply to: Anonymous

wherry huge thanks

now i found out that in LT i can not use LISP's, so is there any other way to get the result
Message 4 of 9
jyan2000
in reply to: Anonymous

it deletes all objects..where do i do wrong?


(defun c:ers ()
(ssget"X"'(0 . "DIMENSION")
(command "erase" "all" "")))
Message 5 of 9
Anonymous
in reply to: Anonymous

>>it deletes all objects

You told it to erase "all." And your parentheses are wrong.

(defun c:ers (/ sset)
(setq sset (ssget "X" '((0 . "DIMENSION"))))
(command "erase" sset "")
(princ))
Message 6 of 9
jyan2000
in reply to: Anonymous

How to make work multi task in in lsp ?
Regards
Victor.

(defun c:ed () (erasedimension nil))
(defun c:epo () (erasepoint nil))
(defun c:epl () (erasepline nil))

(defun erasedimensions (/ sset)
(setq sset (ssget "X" '((0 . "DIMENSION"))))

(defun erasepoint (/ sset)
(setq sset (ssget "X" '((0 . "POINT"))))


(defun erasepline (/ sset)
(setq sset (ssget "X" '((0 . "PLINE"))))


(command "erase" sset "")
(princ))
Message 7 of 9
Anonymous
in reply to: Anonymous

(defun erasebytype (objtype)
(command "erase" (ssget "x" (list (cons 0 objtype))) "")
(princ))

(defun c:ed () (erasebytype "dimension"))
(defun c:epo () (erasebytype "point"))
(defun c:epl () (erasebytype "*polyline"))

The polyine filter contains a wild card character to select either polylines or lwpolylines.

These are rather drastic commands and it isn't clear why they would be needed.
Message 8 of 9
jyan2000
in reply to: Anonymous

Thanx for help Tom,
How about below lisp something like QSELECT command.but i prefer to key in the Command line.It's much faster for me.


(defun selectbytype (objtype)
((ssget "x" (list (cons 0 objtype))) "")

(defun c:seldim () (selectbytype "dimension"))
(defun c:selpoint () (selectbytype "point"))
(defun c:selline () (selectbytype "line"))
(defun c:seltxt () (selectbytype "text,mtext"))
Message 9 of 9
Anonymous
in reply to: Anonymous

The selection function is incorrect.

(defun selectbytype (objtype)
(ssget "x" (list (cons 0 objtype))))

The "x" causes selection of everything in the drawing matching the filter list. Not something that I normally need. Delete the "x" to be prompted for selection, and the selection will then be filtered.

I don't know think the key-ins will be the fastest method. For instance:

Command: MOVE
Select objects: (C:SELLINE)

3 found
Select objects: [return]
Specify base point or displacement: [etc]

To use the selection functions transparently, you will have to enter the entire function name, with parentheses, then enter a return to end the selection.

It would be easier to pre-select a group of objects, then use the upper-left pulldown in the Properties palette to select only the lines, then execute the command.

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

Post to forums  

Autodesk Design & Make Report

”Boost