Frank G Posted June 13 Posted June 13 (edited) Hi friends, I have a problem with the extraction attributes of the block. In the past I had write a routine for export and it was ok in action. Now I have autcad 2021 and this routine non function. This is part of code (defun c;test1 () (setq path (getvar "dwgprefix")) (setq name1 (getvar "dwgname") (seq path_all (strcat path name1)) ;;(setq p1 (list -46763 29023 0.000)) ;;(setq p2 (list -3370 -34457 0.000)) (command "_-dataextraction" "_o" (ssget "_w" p1 p2 '((2 . "tag50")) ) "" "" "" "c:/mydir/template-01.dxe" "csv" path_all );com The file is create, but is empty.... if test on command line it's ok and the csv is full Help me... thanks Edited June 13 by SLW210 Added Code Tags!! Quote
SLW210 Posted June 13 Posted June 13 Please use Code Tags for your code in the future. (<> in the editor toolbar) For starters the defun uses ; instead of : (defun c;test1 () (defun c:test1 () Do you have an example .dwg? Quote
GLAVCVS Posted June 13 Posted June 13 19 minutes ago, Frank G said: Hi friends, I have a problem with the extraction attributes of the block. In the past I had write a routine for export and it was ok in action. Now I have autcad 2021 and this routine non function. This is part of code (defun c;test1 () (setq path (getvar "dwgprefix")) (setq name1 (getvar "dwgname") (seq path_all (strcat path name1)) ;;(setq p1 (list -46763 29023 0.000)) ;;(setq p2 (list -3370 -34457 0.000)) (command "_-dataextraction" "_o" (ssget "_w" p1 p2 '((2 . "tag50")) ) "" "" "" "c:/mydir/template-01.dxe" "csv" path_all );com The file is create, but is empty.... if test on command line it's ok and the csv is full Help me... thanks Hi, It’s likely due to differences in the parameters required by that command in your previous version of AutoCAD compared to those required in the 2021 version. You’ll have no choice but to investigate it. Type the following in the command line: (command "_-dataextraction") Press ENTER and observe what it asks for, so you can compare it with what your code is expecting. Quote
BIGAL Posted June 15 Posted June 15 If you google you will find lots of examples of using a lisp to do what you want, "write attributes to CSV autolisp", you can take advantage of say picking a block to get its name, in a more advanced version using a dcl can choose which attributes to write to say a CSV. A more global answer. For me write direct to Excel no csv. You could do a pick multiple blocks and do the procedure. Post a dwg and a dxe file so can see what your trying to export to a csv. Welcome aboard. Quote
Frank G Posted June 19 Author Posted June 19 Hi, attached the dwg, lisp and dxe I Hope for your help Thank A01R171021.dwg data_extraction_02.lsp MOD-ESTRAZIONE-03.dxe Quote
BIGAL Posted June 19 Posted June 19 I use Bricscad and it does not support the dxe provided. But your lisp has problems this is closer, but not tested in Acad. defun c:dex_01 (/ path01 name01 path_all p1 p2 ) (setvar "cmdecho" 0) (setq path01 (getvar "DWGPREFIX")) (setq name01 (getvar "DWGNAME")) (setq path_all (strcat path01 name01)) (SETQ P1 (getpoint "\nPick 1st point ")) (SETQ P2 (getcorner p1 "\nPick other point ") (command "_-dataextraction" "_o" (ssget "_W" p1 p2 '((0 . "INSERT")(2 . "Info3"))) "" "" "" "C:/my_dir/mod-estrazione-03.dxe" "csv" path_all ) );def Quote
Frank G Posted June 20 Author Posted June 20 29 minutes ago, Frank G said: ok, i making a test (command "_-dataextraction" ":c/my_dir/mod-estrazione-03.dxe" ) Quote
Frank G Posted June 20 Author Posted June 20 with only this command it's solved. Into the dxe model there is all information... 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.