Jump to content

Automating data extraction wizzard


Grenco

Recommended Posts

Hi there!

 

I'm trying to automate the data extraction command/wizzard. My goal is to extract all my revision blocks on my drawing so I can make a drawing(sent-)list. That's no problem, but I don't want to run through the whole wizzard everytime. And I also don't want to set the correct folders.

 

My problems are:

How can I load a template .dxe file and edit his loaded drawingfolder?

With every different project, a different .dxe file. Every project has it's own drawings. But the path where it is, is refoundable with vba or something (thisdrawing.path & "\dxe-folder\XXX.dxe"). The loaded drawing folder is easy as thisdrawing.path.

 

Different output: with every different project, there is a different excel file to be created. This is not the toughest problem I think because if you run the -DATAEXTRACTION command you can enter the path easily.

 

The data extraction function is not in VBA so I only can use it with a "thisdrawing.sendcommand"

 

I've searched, saw that other people also wanted it but every topic didn't have a solution or went dead.

 

Someone has an idea or solution how to make a makro of it?

Link to comment
Share on other sites

  • 9 months later...

Hi there,

 

Is it important for you to generate that Data Extraction file?

You could simply create an excel file and link it to a table in your titleblock?

 

Regards,

SB

Link to comment
Share on other sites

  • 2 years later...

I know this is an old thread, but just in case anyone finds this....

 

 

With regards to wanting the output to be different each time, I have accomplished this using the following steps:

 

 

1. use dataextraction to output to a constant file

2. open a macro-enabled workbook in excel

3. write the location of the currently open file to that workbook

4. use the workbook to execute a macro upon opening

5. use the macro to move the dataextraction to the same directory as the file

6. close excel

 

 

here's the autolisp code:

 

 

(command "-DATAEXTRACTION" "C:\\Data Extraction.dxe" "Y")
(vl-file-copy "[url="file://\\temporary-extract.xls"]C:\\temporary-extract.xls[/url]" (strcat (vla-get-path (vla-get-activedocument (vlax-get-acad-object))) "[url="file://\\data"]\\data[/url] extraction report.xls"))
(OpenExcel "[url="file://\\data_extraction_macro.xlsm"]C:\\data_extraction_macro.xlsm[/url]" "main" vlax-true)
(PutCell "A1" (strcat (vla-get-path (vla-get-activedocument (vlax-get-acad-object))) "[url="file://\\data"]\\data[/url] extraction report.xls"))

hopefully this helps anyone looking for an answer to this issue

Edited by SLW210
Added Code Tags
Link to comment
Share on other sites

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...