i will get custom block in a .dwg file from a list of blocks which I will parse programmatically in Java.
You can use the command INSERT with the option ?
cd C:\Program Files\Autodesk\AutoCAD 2016
accoreconsole.exe /i "Sample\Database Connectivity\Floor Plan Sample.dwg"
Command: _INSERT
Enter block name or [?]: ?
Enter block(s) to list <*>:
Defined blocks.
"CHAIR7"
"COMPUTER"
"DESK2"
"DESK3"
"DOOR"
"DR-36"
"DR-69P"
"DR-72P"
"FC15X27A"
"FC42X18D"
"FNPHONE"
"IBMAT"
"KEYBOARD"
"NCL-HL"
"RECTANG"
"RMNUM"
"SOFA2"
User Unnamed
Blocks Blocks
17 0