Regarding the original code of mr. Lee.
http://www.lee-mac.com/copyblockfromdrawing.htmlHow to make the 'NOT' part of the work as 'OR' ?
Would be really good to have some insert regardless if it was allready 'stolen' or not.
-------------------------=={ Import Block }==-------------------------
This program allows a user to import a block from a selected
drawing into the active drawing, without opening the external file.
Upon calling the program with 'IB' at the command line, the user
is prompted to select a drawing file from which to source the
block to be imported.
Following a valid response, a dialog is displayed prompting the
user to select a block from the list of blocks defined in the
selected drawing
*NOT* (WISH FOR : OR) already present in the current drawing.
Following selection, the definition of the chosen block is imported
into the drawing and the user is prompted to specify a block
insertion point at which a block reference of the imported block
is inserted.
The program will perform successfully in all UCS/Views and is also
compatible with Dynamic Blocks.
----------------------------------------------------------------------
Author: Lee Mac, Copyright © 2013 -
www.lee-mac.com ----------------------------------------------------------------------
Version 1.2 - 16-06-2013
----------------------------------------------------------------------
( (progn
(vlax-for def (vla-get-blocks dbx)
(if
(and
(= :vlax-false (vla-get-isxref def))
(= :vlax-false (vla-get-islayout def))
(not (wcmatch (vla-get-name def) "`**,*|*"))
)
(setq lst (cons (vla-get-name def) lst))
)
)
(not (setq lst (vl-sort[b][i] (vl-remove-if '(lambda ( x ) (tblsearch "block" x)) lst)[/i][/b] '<)))
)
(princ "\nNo distinct blocks found in selected drawing.")
)
This part? (vl-remove-if '(lambda ( x ) (tblsearch "block" x))