- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have written lisp code to import blocks from csv file with attributes. And I want to share it.
To run the lisp first you will need to install OpenDCL for GUI.
GUI_BlockImport.odcl have GUI code made using OpenDCL, you can open and edit it using OpenDCL.
GJM_BlockImport.lsp have all lisp code.
You may need to add (vl-load-com) to lsp file if you get errors.
To run code enter GJM_BlockImport in AutoCAD command line. You should get this window
Symbol Location points to block definition. Is it in current drawing or in other dwg file.
CSV file: (name of last used csv file).
After pressing button "IMPORT" you will need to choose csv file with block data.
Block data in csv file should look like this:
Block name ; X coordinate ; Y coordinate ; Z coordinate ; Attribute1 ; Attribute2 ; ...
After choosing csv file you will get popup window telling about error or window like this:
Now just press OK button and all blocks will be inserted.
This is in beta 🙂
So here may be bugs. If you find bugs write about it here.
I will try to add block export in this lisp in future. In my view it should work like this:
Add new button "EXPORT".
After pressing button "EXPORT" you will be asked to select one block in drawing. Lisp will select all blocks with same name in drawing and show data in window (like above image). After pressing OK you would be asked for csv file location and name. And lisp will export all data to csv file.
Solved! Go to Solution.