- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have made new block import - export command in lisp. It uses OpenDCL to work. So it will need to be installed if you want to use this lisp. After you install OpenDCL and put .lsp and .odcl files in AutoCAD search path you can enter command BlockImportExport
I have made video about how it works
After you enter command a window will open
In section "Blocks" you can see all existing blocks in current drawing. Only three is shown at once but you can slide them with mouse. You can also double clock a block to preview it in bigger window. Button below is for importing new blocks from different drawing file.
Here are few delimiters to choose for importing from csv file, but I used only Auto and it always worked. You can also select Custom and enter your own delimiter.
To left here are 6 buttons, but I have only used 3 of al of them:
- Import button will import csv or txt file with blocks data. I don't use this one.
- Past button will open new window where you can copy-past blocks data from excel directly. I only use this for importing blocks.
- Export button will let choose to options for exporting blocks from drawing. All blocks of same name or blocks from selection. I often use this button.
- Copy button will open new window with blocks data selected for export. You can copy it and past directly to excel. I use this for export.
- Ok button will import blocks to drawing file if Import or Past buttons have been pressed. If Export button was pressed it will late save new csv file with blocks data. I don't use this button for exporting, because I only use Copy button.
- Cancel button will close Import and Export window.
In information section you can see block names for export or import and they count. If you are importing block and block definition don't exist in current drawing file comment column will have comment about it. You can see it in video. You can import and export multiple blocks at same time, but if you exporting blocks you should remember, if you select same block in multiple selections of Export button you will have multiple copies of same block.
At the bottom is spreadsheet with blocks data.
If you have more questions, you can ask them here.
P.S. CSV file needs to have this columns: Block name, X coordinate, Y coordinate, Elevation
These four are essential. Without them import will not work. After them here can be any number of attribute data, or none.
P.S.S Columns in window are named: Name, Y, X, Elevation. This is because in my country AutoCad coordinate X is named Y and coordinate Y is named X.
You can change names in lsp file at lines 42 and 43
; Columns names for blocks data grid.
(dcl-Grid-AddColumns BlockIE/Main/GridData
(list
(list "Name" 0 100)
(list "Y" 1 80)
(list "X" 1 80)
(list "Elevation" 1 70)
)
)
Solved! Go to Solution.