Message 1 of 6

Not applicable
04-23-2018
11:02 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everybody
I would like to ask for some help in automating this as it would save me a lot of time and errors.
The problem:
We have a bunch of dwg files in a folder. We need to change the value of the attribute MyAttribute in the block MyBlock in all of the drawings.
So far, we have been using a lisp file to do this. It is saved as a STARTUP lisp and it contains an an Attedit, saves and closes. We launch Autocad, and in the open option we select to open all the drawings we want to modify, so, one after another, they are opened, modified and closed automatically. As we work with several patterns of Blocks and Attributes, we have already coded all Attedits we need in the .lsp and we simply comment/uncomment and modify the values to replace.
But now, we would like to make a script out of it so that it can be used in AutoCad LT.
My ideas:
Note that we have very basic lisp knowledge, and have never worked with scripts.
Obviously the first step is getting a scr file doing the attedit. I am working on it, and I feel it shouldn't be that hard. If someone could help with that it'll amazing, but I feel I can do this one.
But my problem comes here. Once the simple attedit is made, I can write a script that opens a file, performs the attedit, saves and closes. I know how to do this writing individually the complete path for all the files. This feels possible, but wouldn't fix my problem as it'll be extremely time consuming.
I've searched and found some lisp routines and add-ons that help writing scripts this way, but they're to be used as lisps in complete AutoCAD versions, so that wouldn't solve my issue.
Another idea I got from this forum was creating a for loop in a .bat file. I don't really know how it works, tbh. Other option I am thinking is to write a C program that creates the script by reading the path, block names ans attributes from a tct file that I would modify every time. However, I feel there must be a more efficient solution.
So that's it. I would need a solution that allows me to easily change the path of the folder I want to batch attedit and change the block name, attribute name and values to replace, using AutoCad LT.
Any help or idea would be kindly appreciated.
Thank you so much
Best regards
I would like to ask for some help in automating this as it would save me a lot of time and errors.
The problem:
We have a bunch of dwg files in a folder. We need to change the value of the attribute MyAttribute in the block MyBlock in all of the drawings.
So far, we have been using a lisp file to do this. It is saved as a STARTUP lisp and it contains an an Attedit, saves and closes. We launch Autocad, and in the open option we select to open all the drawings we want to modify, so, one after another, they are opened, modified and closed automatically. As we work with several patterns of Blocks and Attributes, we have already coded all Attedits we need in the .lsp and we simply comment/uncomment and modify the values to replace.
But now, we would like to make a script out of it so that it can be used in AutoCad LT.
My ideas:
Note that we have very basic lisp knowledge, and have never worked with scripts.
Obviously the first step is getting a scr file doing the attedit. I am working on it, and I feel it shouldn't be that hard. If someone could help with that it'll amazing, but I feel I can do this one.
But my problem comes here. Once the simple attedit is made, I can write a script that opens a file, performs the attedit, saves and closes. I know how to do this writing individually the complete path for all the files. This feels possible, but wouldn't fix my problem as it'll be extremely time consuming.
I've searched and found some lisp routines and add-ons that help writing scripts this way, but they're to be used as lisps in complete AutoCAD versions, so that wouldn't solve my issue.
Another idea I got from this forum was creating a for loop in a .bat file. I don't really know how it works, tbh. Other option I am thinking is to write a C program that creates the script by reading the path, block names ans attributes from a tct file that I would modify every time. However, I feel there must be a more efficient solution.
So that's it. I would need a solution that allows me to easily change the path of the folder I want to batch attedit and change the block name, attribute name and values to replace, using AutoCad LT.
Any help or idea would be kindly appreciated.
Thank you so much
Best regards
Solved! Go to Solution.