×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Attribute Export Macro

Attribute Export Macro

Attribute Export Macro

(OP)
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

RE: Attribute Export Macro

Hi Joe,

Sure, what does your macro look like now?

Todd

RE: Attribute Export Macro

(OP)
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)

RE: Attribute Export Macro

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.

RE: Attribute Export Macro

Hi Joe,

Carl's got the answer!

Todd

RE: Attribute Export Macro

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?

RE: Attribute Export Macro

(OP)

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

RE: Attribute Export Macro

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.

RE: Attribute Export Macro

(OP)
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..


Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources