hsolon Posted May 2, 2006 Posted May 2, 2006 I was wondering how to create a drawing based on information from an xcel spread sheet. I already have a spread sheet created that generates the width length and angle of tile, but I was wondering how I could make autocad see this to create my views and dimension them for me. Please point me in the right direction! Quote
rkmcswain Posted May 2, 2006 Posted May 2, 2006 http://www.dotsoft.com/autocell.htm has limited "push" capability for certain entity types where it's logical. Scroll down about 1/3 of the way on that page until you see "2-Way Linkage" Quote
rkmcswain Posted May 8, 2006 Posted May 8, 2006 Use a add-on for AutoCAD. EasyTable For AutoCAD That looks like it's for importing tables into AutoCAD, like XL2CAD from Dotsoft You might want the reread the original post. I think the OP is looking for something to draw entities based on dimensions in a spreadsheet. Quote
fixo Posted May 8, 2006 Posted May 8, 2006 I was wondering how to create a drawing based on information from an xcel spread sheet. I already have a spread sheet created that generates the width length and angle of tile, but I was wondering how I could make autocad see this to create my views and dimension them for me. Please point me in the right direction! I don't understood what you mean about the width length and angle of tile Better yet you need to attach the drawing for the better understanding Maybe I can help you Another question is on wich language you need this program: Lisp, VBA or so I think the best way for this case would be VBA Fatty ~'J'~ Quote
hsolon Posted May 16, 2006 Author Posted May 16, 2006 Sorry it took so long to reply, I have been incredably busy. Unfortunately I cannot post the drawing do to company policy and international trade agreements. I am trying to create a VBA program that will draw rectangles from parameters that are generated in excell. The premise. I want to prompt the user for lets say a length and a diameter of a cylinder. Through VBA I want to enter these values into a pre-existing excell spread sheet. The spread sheet will then determine how many columns and rows of brick I will need to cover the above cylinder. The rules of the spreadsheet would be as follows, The brick can be no longer than 9 inches and no wider than 3-1/2 inches. It can also range in thickness from 1/2 inch to 2 inch depending on user input. The spread sheet calculates the circumference and determines how to cover the area evenly with brick (using the most of the 9 x 3.5 as possible). Essentionally it determines a polygon that will fit as closley to the diameter as possible and generetes a new length and width to cover the area. Quote
fixo Posted May 16, 2006 Posted May 16, 2006 I am very interested with such task It is possible let you to do as follows (to not break the policy of your company): Prepare sample Excel file as the table how should look the data in this table, also prepare the simple drawing with full explanatories, visually it will be easier to me to understand definition of the subsequent actions I have already made a preliminary part of the program which defines from the table the sizes of tiles and draws them then in AutoCAD If this variant is arranges to you, send these files on: fixo@yandex.ru Fatty ~'J'~ Quote
Elpanov Evgeniy Posted May 16, 2006 Posted May 16, 2006 ;| GET_XL.LSP Created by Elpanov Evgeniy [email="842@list.ru"]842@list.ru[/email] [email="elpanov@gmail.com"]elpanov@gmail.com[/email] Data reading from Microsoft Excel not using Excel. This code, can read diverse data from all tables. ARGUMENTS: A string containing a complete file name, including the path. (setq tbl "D:\\7.xls") USAGE: (GET_xl tbl) RETURN VFALUES The list of all pages in a file with all data |; (defun rec-rem-dupl (lst) (if lst (cons (car lst) (rec-rem-dupl (vl-remove (car lst) (cdr lst)))) ) ;_ if ) ;_ defun (defun GET_xl (tbl / ADOCONNECT ADORECORDSET LST) (setq ADOConnect (vlax-get-or-create-object "ADODB.Connection") ADORecordset (vlax-get-or-create-object "ADODB.Recordset") ) ;_ setq (if (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-invoke-method) (list ADOConnect "Open" (strcat "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" tbl ";Extended Properties=;Excel 8.0;HDR=No" ) ;_ strcat "admin" "" nil ) ;_ list ) ;_ vl-catch-all-apply ) ;_ vl-catch-all-error-p ) ;_ not (progn (setq lst (mapcar (function (lambda (l / i c) (vlax-invoke-method ADORecordset "Open" (strcat "SELECT * FROM [" l "]") ADOConnect 1 3 nil ) ;_ vlax-invoke-method (setq i (length (car (vlax-safearray->list (vlax-variant-value (vlax-invoke-method ADORecordset "GetRows" 65535 ) ;_ vlax-invoke-method ) ;_ vlax-variant-value ) ;_ vlax-safearray->list ) ;_ car ) ;_ length ) ;_ setq (vlax-invoke-method ADORecordset "Close") (while (not (zerop i)) (vlax-invoke-method ADORecordset "Open" (strcat "SELECT * FROM [" l "a" (itoa i) ":IV" (itoa i) "]") ADOConnect 1 3 nil ) ;_ vlax-invoke-method (setq c (cons (car (apply (function mapcar) (cons 'list (mapcar (function (lambda (a) (mapcar (function (lambda (b) (vlax-variant-value b) ) ;_ lambda ) ;_ function a ) ;_ mapcar ) ;_ lambda ) ;_ function (vlax-safearray->list (vlax-variant-value (vlax-invoke-method ADORecordset "GetRows" 65535 ) ;_ vlax-invoke-method ) ;_ vlax-variant-value ) ;_ vlax-safearray->list ) ;_ mapcar ) ;_ cons ) ;_ apply ) ;_ car c ) ;_ cons i (1- i) ) ;_ setq (vlax-invoke-method ADORecordset "Close") ) ;_ while (if (equal c '((nil) (nil))) (list l) (cons l c) ) ;_ if ) ;_ lambda ) ;_ function (rec-rem-dupl (caddr (mapcar (function (lambda (a) (mapcar (function vlax-variant-value) a ) ;_ mapcar ) ;_ lambda ) ;_ function (vlax-safearray->list (vlax-variant-value (vlax-invoke-method (vlax-invoke-method ADOConnect "OpenSchema" 4 ) ;_ vlax-invoke-method "GetRows" 65535 ) ;_ vlax-invoke-method ) ;_ vlax-variant-value ) ;_ vlax-safearray->list ) ;_ apply ) ;_ caddr ) ;_ rec-rem-dupl ) ;_ mapcar ) ;_ setq (vlax-invoke-method ADOConnect "Close") (vlax-release-object ADORecordset) (vlax-release-object ADOConnect) (setq ADORecordset nil ADOConnect nil ) ;_ setq lst ) ;_ progn (progn (vl-catch-all-apply 'vlax-invoke-method (list ADOConnect "Close") ) ;_ vl-catch-all-apply (vlax-release-object ADORecordset) (vlax-release-object ADOConnect) (setq ADORecordset nil ADOConnect nil ) ;_ setq nil ) ;_ progn ) ;_ if ) ;_ defun Quote
minhphuong_humg Posted November 30, 2013 Posted November 30, 2013 ;| GET_XL.LSP Created by Elpanov Evgeniy [email="842@list.ru"]842@list.ru[/email] [email="elpanov@gmail.com"]elpanov@gmail.com[/email] Data reading from Microsoft Excel not using Excel. This code, can read diverse data from all tables. ARGUMENTS: A string containing a complete file name, including the path. (setq tbl "D:\\7.xls") USAGE: (GET_xl tbl) RETURN VFALUES The list of all pages in a file with all data |; (defun rec-rem-dupl (lst) (if lst (cons (car lst) (rec-rem-dupl (vl-remove (car lst) (cdr lst)))) ) ;_ if ) ;_ defun (defun GET_xl (tbl / ADOCONNECT ADORECORDSET LST) (setq ADOConnect (vlax-get-or-create-object "ADODB.Connection") ADORecordset (vlax-get-or-create-object "ADODB.Recordset") ) ;_ setq (if (not (vl-catch-all-error-p (vl-catch-all-apply (function vlax-invoke-method) (list ADOConnect "Open" (strcat "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" tbl ";Extended Properties=;Excel 8.0;HDR=No" ) ;_ strcat "admin" "" nil ) ;_ list ) ;_ vl-catch-all-apply ) ;_ vl-catch-all-error-p ) ;_ not (progn (setq lst (mapcar (function (lambda (l / i c) (vlax-invoke-method ADORecordset "Open" (strcat "SELECT * FROM [" l "]") ADOConnect 1 3 nil ) ;_ vlax-invoke-method (setq i (length (car (vlax-safearray->list (vlax-variant-value (vlax-invoke-method ADORecordset "GetRows" 65535 ) ;_ vlax-invoke-method ) ;_ vlax-variant-value ) ;_ vlax-safearray->list ) ;_ car ) ;_ length ) ;_ setq (vlax-invoke-method ADORecordset "Close") (while (not (zerop i)) (vlax-invoke-method ADORecordset "Open" (strcat "SELECT * FROM [" l "a" (itoa i) ":IV" (itoa i) "]") ADOConnect 1 3 nil ) ;_ vlax-invoke-method (setq c (cons (car (apply (function mapcar) (cons 'list (mapcar (function (lambda (a) (mapcar (function (lambda (b) (vlax-variant-value b) ) ;_ lambda ) ;_ function a ) ;_ mapcar ) ;_ lambda ) ;_ function (vlax-safearray->list (vlax-variant-value (vlax-invoke-method ADORecordset "GetRows" 65535 ) ;_ vlax-invoke-method ) ;_ vlax-variant-value ) ;_ vlax-safearray->list ) ;_ mapcar ) ;_ cons ) ;_ apply ) ;_ car c ) ;_ cons i (1- i) ) ;_ setq (vlax-invoke-method ADORecordset "Close") ) ;_ while (if (equal c '((nil) (nil))) (list l) (cons l c) ) ;_ if ) ;_ lambda ) ;_ function (rec-rem-dupl (caddr (mapcar (function (lambda (a) (mapcar (function vlax-variant-value) a ) ;_ mapcar ) ;_ lambda ) ;_ function (vlax-safearray->list (vlax-variant-value (vlax-invoke-method (vlax-invoke-method ADOConnect "OpenSchema" 4 ) ;_ vlax-invoke-method "GetRows" 65535 ) ;_ vlax-invoke-method ) ;_ vlax-variant-value ) ;_ vlax-safearray->list ) ;_ apply ) ;_ caddr ) ;_ rec-rem-dupl ) ;_ mapcar ) ;_ setq (vlax-invoke-method ADOConnect "Close") (vlax-release-object ADORecordset) (vlax-release-object ADOConnect) (setq ADORecordset nil ADOConnect nil ) ;_ setq lst ) ;_ progn (progn (vl-catch-all-apply 'vlax-invoke-method (list ADOConnect "Close") ) ;_ vl-catch-all-apply (vlax-release-object ADORecordset) (vlax-release-object ADOConnect) (setq ADORecordset nil ADOConnect nil ) ;_ setq nil ) ;_ progn ) ;_ if ) ;_ defun please, correct your code. I think error code. Thank you. Quote
Recommended Posts
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.