Look into using ssget instead.
Registered forum members do not see this ad.
Hi All,
how can I use QSELECT command in lisp and set its parameters to select a specific block through block name filter.
Cheers
Ali




Look into using ssget instead.
I have dynamic blocks so I prefer to use QSELECT.
QSelect doesn't have a commandline option.
DropBox | finding the light...
Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...
If you want to roll your own, you can specify the block name and cycle through a selection (removing what doesn't match the vla-get-effectivename) and the use sssetfirst to select what's left.
This will select all dynamic blocks and blocks matching the specified name. From there, you can cycle (what I said above).Code:(ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`*U*," name))))
DropBox | finding the light...
Seann: ...it went crazy ex-girlfriend on me...
eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...
After weeks I came back to this and I confused!
so it is better to simplify the situation.
Let's say I have a dynamic block inserted on the screen and I know the name of the dynamic block.
How can I select that dynamic block by it's name?
Cheers
Ali
Ali,
you can filter any Entity you want with Autolisp, but to put selection on hold is not that needed, so there must be an action to do after selecting any Entity.
For example this lisp is made by me it will ask you to select a block and it will insert the selected Block with non stop action until you hit enter. Try it.
TharwatCode:(defun c:qs (/ a ins) (setq b (cdr(assoc 2 (entget(car(entsel"\nSelect a Block: ")))))) (while (setq ins (getpoint"\n Insertion point <enter to exit> :")) (command "_insert" b ins "" "" "" )) (princ "Written by Tharwat") (princ))
Hi
Your question is not clear and to whom it is dedicated ?
clarify please
Tharwat
When a dynamic blocks properties are altered, it becomes an anonymous block, therefore you are unable to select it using its name in an ssget filter, rather, use the filter that Alan has suggested, and filter through the resultant set (should there be one), and check against the EffectiveName property.
Lee Mac Programming
With Mathematics there is the possibility of perfect rigour, so why settle for less?
Just another Swamper

Registered forum members do not see this ad.
Sorry to gravedig here . I need to be able to select a block and have AutoCAD tell me how many times that block has been placed in the drawing file. Tharwat's routine looks like it could be altered to do this - but I have no idea how to do so. Can anyone assist please ?
Bookmarks