Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attribute Export Macro 1

Status
Not open for further replies.

darkcobra

Industrial
Nov 5, 2005
9
Hi to All..

I am trying to create a macro button that will export attribute data to a common output file all the time with a path that I preset in the button (This is because my Excel macro is looking for this exported data in one file in a certain folder).

The problem I am having is that the Output file is always pathing out to the location where the DWG file is located.

Can someone teach me how to write the output file to the same location everytime. I have tried a few things but they have not worked.

-Joe
 
Replies continue below

Recommended for you

C^Cfiledia 0 -attext C C:\DSE\DEVICE-SCHEDULE.TXT y filedia 1

This is basically what I am trying to achieve:

fieldia 0 first to allow me command prompt entry of the paths.

then -attext and C for comma delimited...

then a space to accept the template file path (which has been good to me and not changing) ..

It's the next step for the output file that is killing me.. AutoCAD is always defaulting to the file path of the DWG file.. (As you can see, I typed the path I want above, but all I get is failure when I run the macro).

The "y" at the end is so it would overwrite the exisiting file in that above path. and has worked previously when I do not use the file path but substitute just the filename instead.(it writes to my documents folder)
 
Since a backslash is a special character to cause a macro to pause for user input, I suggest you try a forward slash for path separator.
 
Yeah what he said.
What exactly are you doing with this text info anyway. I'm not familar with exporting attribute data to a .txt file. Can you explain so perhaps I may utilize this procedure?
 

I'll try the forward slash instead , but I thought that the path would then be that of an Internet format or something instead of a normal file path. but like you guys said, it seems to be a coding thing more than traditional pathing.



loosestring,

I plan to export the attribute data to this text file in a "CDL" format (comma delimited)using ATTEXT

I know it's intermediate AutoCAD at best, but what I can do with the Text file is an easy data import into Excel as a "CDL" file and then populate the spreadsheet with the data. I've already created a macro button in Excel that creates the whole template and populates the data automatically from the TXT file with 1 click.


Thanks Guys...
 
Wow that's pretty cool. I'll have to look into that more.
Yeah when you are doing macros in acad a backslash = a pause for user input where the forward slash is used in file paths.
 
It is a success !!!

I now have a macro button to extract all attribute data to a file from AutoCAD ... AND ... I have a Macro Button in Excel to import the data from the file I created at the specified location.

Thanks for the file path Info ..


PS: Does anyone have a good website for macro use within Autocad that would show me basic macro creation and the meaning behind all the characters in programming them..


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor