This will insert a dynamic block with attributes, from a custom menu.
1. Create a folder which contains the dynamic blocks, and the MNU file mentioned below.
2. Load the MNU file using CUILOAD from the command menu. AutoCAD automatically creates a CUIX file.
3. In Tools, Options, Files tab, Support File Search Path ... add the folder mentioned above.
4. The LISP code for "BlockInsert" is shown below and can be set to autoload.
The issue is: I don't want to enter the attributes in the command line when inserting the block.
Is there a code which would ignore this and just insert only?
MNU FILE
***MENUGROUP=AID_DYNAMIC
***POP111
**CTOPopAID_DYNAMIC
[Aid (D)]
[<-View-Reference]^C^C(BlockInsert "Aid_View-Reference");scale;1;
[--]
LISP FILE
(defun BlockInsert (blkname)
(command "_.-insert" (substr (strcat blkname "-" (menucmd "m=$(edtime,0,yymoddhhmmss)") "=" blkname) (+ (vl-string-position (ascii "_") blkname 1) 2)) pause 1 "" 0)
)