Hi everyone,
Does anyone know of or if its possible to select an object, specify an area and then run selectsimilar within that area? So that similar objects that are out of the region arnt selected?
Much appriciated!
|
|
|
Hi everyone,
Does anyone know of or if its possible to select an object, specify an area and then run selectsimilar within that area? So that similar objects that are out of the region arnt selected?
Much appriciated!
How will you determine "a similar object(s)"? A very simple example is to use (ssget) filters like this:
And so on.Code:(defun c:selsim (/ selset ent res enttype) (vl-load-com) (if (and (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (setq ent (car (entsel "\nSelect an entity <Cancel> : "))) ) ;_ end of lambda ) ;_ end of vl-catch-all-apply ) ;_ end of vl-catch-all-error-p ) ;_ end of not ent (not (vl-catch-all-error-p (vl-catch-all-apply '(lambda () (setq selset (ssget (list (assoc 0 (entget ent))))) ) ;_ end of lambda ) ;_ end of vl-catch-all-apply ) ;_ end of vl-catch-all-error-p ) ;_ end of not selset ) ;_ end of and (sssetfirst selset selset) ) ;_ end of if ) ;_ end of defun
In a single statement
(ssget (list (cons 0 (cdr (assoc 0 (entget (car (entsel "\nSelect Object: "))))))))
Will allow you to select an entity like for example a line and then when you select other objects it will only allow you to select lines.
Peter
> Peter: Try to press <Esc> button during selecting object in my code and in your code.
It's probably worth pointing out that selectsimilar only seems to be available in vertical products - Civil3D has had it for a while. I know vanilla 2007 and LT 2008 don't have it.
Basically you can grab any object and use selectsimilar to select all objects of the same type on the same layer. It's a great quick alternative to qselect, but completely inflexible and not in any help files that I can find.
Yeah im using ADT/ACA my first thoughts were using that command but defining the area for it to look but that didnt really work out, the solution posted above works perfect (for what i need it for anyway )
Here's one which allows you to select what properties to compare. It doesn't use a defined area, but rather selects from a selection set - so you can select an area by crossing or fence if you so wish.
how does this work once it's loaded. i tried "selsim" but it doesn't do anything - sorry, this is my first attempt at a lisp routine
ok...think i figured it out. load the application into autocad. type lsp then "command" type the command then it's loaded and will work. correct?
hmmm...still having difficulty. had it once
anyways, what do you do with the selection set? can't figure out how to filter it. sorry for being a noob.
Last edited by mark.momper; 2008-02-26 at 03:39 PM.
Load lisp & enter selsimilar at the command line.