Jump to content

Convert table from AutoCAD to Excel - BlockTable to Excel


Recommended Posts

Posted

Quickly exports a table of Lines and Texts or Attribute blocks to a Table For the table of unknown attribute blocks, please use BURST command to burst all blocks first.
 

General Usage Instructions

BlockToExcel - Export table of attribute block or Lines and Texts to excel
You can download the supported table styles from here https://www.mediafire.com/file/4u2zun3l12smtjc/Table_English.dwg/file

If your table includes Lines and Texts or Unknown attribute blocks:
1. Run the BURST command to explode all attribute blocks

2. Run the B2E command.

- Select all exploded objects.

- Specify steel layer (if any).

- Enter to finish command.

 

Download: https://apps.autodesk.com/ACAD_E/en/Detail/HelpDoc?appId=4761456461459704560&appLang=en&os=Win32_64

 

spacer.png

 

spacer.png

 

Source: www.lisp.vn

  • 8 months later...
  • 5 months later...
Posted

spam? you can use Python and BeautifulSoup

 

import traceback
from pyrx_imp import Rx, Ge, Gs, Db, Ap, Ed
import wx

import requests
from bs4 import BeautifulSoup as bs
import pandas as pd


# sample source https://www.scraperapi.com/blog/python-loop-through-html-table/
def scraper9000():
    url = "https://datatables.net/examples/styling/stripe.html"
    response = requests.get(url)
    soup = bs(response.text, "html.parser")
    table = soup.find("table", class_="stripe")
    
    data = {
        'Name': [],
        'Position': [],
        'Office': [],
        'age': [],
        'Start date': [],
        'salary': [],
    }
    for employee_data in table.find_all("tbody"):
        for row in employee_data.find_all("tr"):
            data['Name'].append(row.find_all("td")[0].text)
            data['Position'].append(row.find_all("td")[1].text)
            data['Office'].append(row.find_all("td")[2].text)
            data['age'].append(row.find_all("td")[3].text)
            data['Start date'].append(row.find_all("td")[4].text)
            data['salary'].append(row.find_all("td")[5].text)
            
    return data

def PyRxCmd_doit():
    try:
        db = Db.curDb()
        df = pd.DataFrame(scraper9000())
        table = Db.Table()
        table.setDatabaseDefaults(db)
        table.setSize(df.shape[0]+2, df.shape[1])
        table.setTextString(0, 0, "Scrape Master 9000")
        headers = df.columns.values.tolist()
        datas = df.values.tolist()
 
        for col, value in enumerate(headers):
            table.setTextString(1, col, "{}".format(value))
 
        for row, data in enumerate(datas):
            for col, value in enumerate(data):
                table.setTextString(row+2, col, "{}".format(value))
 
        model = Db.BlockTableRecord(db.modelSpaceId(), Db.OpenMode.kForWrite)
        model.appendAcDbEntity(table)
    except Exception as err:
        traceback.print_exception(err)

 

 

table.png.42db563a811014c93c284b00f53f8489.png

  • Like 1
Posted

Spammer removed. I was already suspicious of them. 

  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...