asad112 Posted September 19, 2012 Share Posted September 19, 2012 I have searched around for a similar problem, but did not seem to find it. If anyone can point me to where this has been discussed, this thread can be closed. Anyways, I am about to pull my hair out. I have used a program called Script Maker v. 1.0.4 to create simple batch scripts to update attributes in my title blocks that exist in multiple drawings. This is the essence of the command: PSPACE GATTE 0,0 APPROVALDATE [here I enter the new text] Y _QSAVE CLOSE When those commands are generated on with a script containing the desired files, for some reason the script malfunctions around the 7th drawing. Today, I downloaded a demo of Hurricane for AutoCAD, which is a more user friendly program that does just about the same thing. This is the script it generates: (LOAD "C:/PROGRAM FILES (X86)/HURRICANE/LISP/TB_WIZ1.LSP") ;------------- TB_WIZ1 "title-sheet" approvaldate 09/19/12 REGEN ;------------- Again, it works first few drawings (in this case the first three drawings), but malfunctions on the fourth drawing. This is very frustrating because I had no problems with this on my previous computer. Now, on a new faster computer, I having these problems. I am even having them on the exact same drawing files that had no issues on the previous computer. I have attached the text as it is executed in both versions. Thanks! Script1.txt Script2.txt Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 19, 2012 Share Posted September 19, 2012 Is it your feeling that the script is running too fast? Can a "pause" be built into a script? Quote Link to comment Share on other sites More sharing options...
asad112 Posted September 19, 2012 Author Share Posted September 19, 2012 I have tried entering a 3 second delay after each set of related commands, it didn't seem to fix the issue. As a matter of fact, it just push off the problem to drawings later on in the sequence. It is so bizarre. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 19, 2012 Share Posted September 19, 2012 What version of AutoCAD were you running previously? Quote Link to comment Share on other sites More sharing options...
asad112 Posted September 19, 2012 Author Share Posted September 19, 2012 The previous version was 2013. I am just using it on a new computer. But this script was also successful on 2009 and 2011. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 19, 2012 Share Posted September 19, 2012 Makes one wonder why then a new computer would have any influence over a script file. Weird. You got me puzzled. Quote Link to comment Share on other sites More sharing options...
asad112 Posted September 19, 2012 Author Share Posted September 19, 2012 I am thinking about just trying to reinstall AutoCAD, but that is such a pain. Quote Link to comment Share on other sites More sharing options...
Patrick Hughes Posted September 19, 2012 Share Posted September 19, 2012 It might be "crashing" if the drawing does not have the attribute in the drawing. Have you looked to see if the offending drawings do have it? Quote Link to comment Share on other sites More sharing options...
asad112 Posted September 19, 2012 Author Share Posted September 19, 2012 Yeah, they all have the attribute. I confirmed this by going in manually and performing the commands and it worked fine. I am trying it now with Autodesk Script pro, and I am having better luck because it uses a timeout feature when a drawing is not responding. From the 16 drawings in this set, #7 through #10 do not update. Oddly enough, script pro shows a status of "failed" for the successful updates, and a status of "done" for the unsuccessful updates. Therefore, I think I have been able to narrow the problem down to this hookup: Command: _.SCRIPT Enter script file name : C:\Users\Adam\Desktop\TEST.SCR Command: PSPACE Already in paper space. Command: GATTE Initializing... Select block or attribute [block name]: 0,0 Command: 0,0 Unknown command "0,0". Press F1 for help. I am certain that there is a block located at 0,0. Because when I going in manually and perform GATTE, and enter 0,0, it shows me all the attributes available for modification. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 19, 2012 Share Posted September 19, 2012 It sounds like you are making some progress at least. I hope it gets better. Quote Link to comment Share on other sites More sharing options...
asad112 Posted September 19, 2012 Author Share Posted September 19, 2012 After a lot of guess work, it appears the problem was that the script was not finding the coordinates I was providing. I had a few drawings where "0,0" (as "0,0" were the coordinates I was providing to gatte) was obscured by the bottom of the workspace screen. The simple fix was to add a ZOOM and then EXTENTS command before GATTE. I swear, sometimes AutoCAD presents us with the most trivial and aggravating of issues. Anyways, thanks you guys for your input. Quote Link to comment Share on other sites More sharing options...
ReMark Posted September 19, 2012 Share Posted September 19, 2012 Glad to hear you finally got it figured out and thanks for updating us. Quote Link to comment Share on other sites More sharing options...
pendean Posted September 22, 2012 Share Posted September 22, 2012 I think you answered your own question earlier: after adding a three second delay more files got processed and only later files started to fail.So try 4-5-6-7-8-9-10 second delays until the set is complete. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 23, 2012 Share Posted September 23, 2012 I have posted elsewhere the problem of zooming sometimes, in some lisps you do the same manually and it works because you have zoomed in, this has been a problem with Autocad for say 20+ years. Its a hidden bug its like if you can not see it I will not work, simple work around is use Z C 0,0 scale this way you control how much you can see, using Z E can bring other problems that wrong objects will be picked. You should not need any time delays. I have processed multi drawings and never needed time delay. I would use a bit of lisp to get entries this stops any problems of autocad using and continuing on rather than asking. PSPACE (setq ans (getstring "\n[here I enter the new text]')) GATTE 0,0 APPROVALDATE ans Y _QSAVE CLOSE Quote Link to comment Share on other sites More sharing options...
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.