aridzv Posted August 10, 2023 Posted August 10, 2023 (edited) Hi. This time for a change I am not whining about problems, but sharing a lisp created by knowledge shared here on the forum and I hope this lisp will be useful to other members here as it was effective for me. the lisp prompt the user to select the block to use for the selection set and then promt the user to select the items in the desiered area and select only the blocks of the of the desiered block that was selected in the first step. the lisp also select parametric blocks (I'm a bricscad user...) with *U name,probebly a dynamic blocks in autocad. regards, aridzv. Sel_Bl_ByName.lsp Edited August 10, 2023 by aridzv 1 Quote
mhupp Posted August 11, 2023 Posted August 11, 2023 This is what I use to select similar items visible on screen. works on anything even blocks and you only have to make one selection. SSW.lsp Quote
aridzv Posted August 11, 2023 Author Posted August 11, 2023 @mhupp I couldn't quite get it to work... I picked the object use in select similar, then slected the items to look in, but no items where selectet... Quote
mhupp Posted August 12, 2023 Posted August 12, 2023 (edited) it only selects similar things you can when you run the command. if the original entity isn't on screen it wont be part of the selection after the command is run. Video.mp4 Edited August 12, 2023 by mhupp Quote
j2lstaples Posted August 14, 2023 Posted August 14, 2023 I was using something like this. I don't know who it is from, but I modified it a little bit. ;********************************************************; ; Block Name Filter ; ss [selection-set] from ssget ; blknamelist [list] - list of [str] of effective block names to filter (e.g. "SUSPENSION2", "IBEAM PLAN") ; ss_new [selection-set] - Filtered selection set of ssnames of blocks (defun MA:block_filter (ss blknamelist / count i ent obj ss_new) (if ss (progn (setq ss_new (ssadd)) (setq count (sslength ss)) (setq i -1) (repeat count (setq ent (ssname ss (setq i (1+ i)))) (setq obj (vlax-ename->vla-object ent)) (foreach blkname blknamelist (if (or (wcmatch (strcase (LM:al-effectivename ent) T) (strcat "*" blkname "*") ) (= blkname (LM:al-effectivename ent)) ) (ssadd ent ss_new) ) ) ) ss_new ;(sssetfirst nil ss_new) ; Can be used to see which entities are highlighted ) ) ) It needs Lee-Mac's LM:al-effectivename sub-function. I use it by typing: (MA:block_filter (ssget "_X") (list "BLOCK1" "BLOCK2")) Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.