Select specific blocks in selected area with window - to excel

Select specific blocks in selected area with window - to excel

eoconnor95662
Enthusiast Enthusiast
1,133 Views
1 Reply
Message 1 of 2

Select specific blocks in selected area with window - to excel

eoconnor95662
Enthusiast
Enthusiast

I have been lurking these forms for bits of lisp code for a while now and have come up with a series of LSP files that can do the job decently well.

 

I will begin by defining my task and current process (in case you can think of shortcuts), I will then give the code I have that works in its own way. Select blocks in specific areas (denoted by a thick PLINE) then use BCOUNT or LISP function to export BCOUNT to excel, then sort and filter multiple CAD BCOUNTS into a master excel doc.

 

Areas for improvement:

Priority 1: Filter BCOUNTS (by name) (some may not need to be exported and are irrelevant)

Priority 2: combine multiple BCOUNTS into easy to sort format (like have missing values spit out 0)

 

OPTION 1:

_Function for setting up for text selection_

attached: OutlineLWpolyline.lsp

_Function for selecting text for BCOUNT(this and previous code together is an awful lot of work to select for multiple sections)_

attached: BCOUNTPL.lsp

 

Then I copy and paste into the CMD window into Excel.

_________________________________________________________________

OPTION 2:

The other method (quicker)

Select area(s) with cursor, Shift select areas not wanted,

_Function to extract to excel_

BLOCKS2EXCEL.LSP (just need block name and quantity (attributes would be nice but not needed)

 

If possible I would like code that grabs blocks from inside multiple PLINE widths (found code that grabs everything touching the PLINE but not inside the width) and exports it into a excel file. The icing on the cake for me would be some sort of name filtering in a bcount like lisp command sorta like what you can do with attribute extraction text file.

 

 

Thank you so much for reading and I look forward to reading through the responses.

 

 

0 Likes
Accepted solutions (1)
1,134 Views
1 Reply
Reply (1)
Message 2 of 2

DannyNL
Advisor
Advisor
Accepted solution

Take a look at the standard command DATAEXTRACTION.

No LISP required and this should be able to give you all or a large part of the result you need afaik.