
WashCaps37
Members-
Posts
18 -
Joined
-
Last visited
Everything posted by WashCaps37
-
Your code is SWEET!!!! your code is a lot more stable. I did find out that "!{TAB} in my code in Send("!{TAB}^{PGDN}",0) was the culprit of the stability problem. !{TAB} would cause the code to end up opening other applications and type jibberish. I like how your code shows the Tabbing.....(# of #) and what layout tab it is on. If you noticed on my old code I added a couple of things like setting the PSLTSCALE to 0 and then Zoom Extents before going on to the next layout tab. How/Where would I incorporate those commands into your code? I figured since this code is cycling through the layouts why not save more time by having it perform these other commands too. Thanks for all of your help! I can't thank you enough! WashCaps37
-
I do not have AutoCAD 2004, but I do have AutoCAD 2002 and 2005. By your description, the page setup dialog for 2002 sounds similar to 2004 so I tested the following in 2002. The following assumes the AutoCAD Page Setup dialog is open and on the correct tab. The {+} ensures the box gets checked and not toggled the wrong way ({-} would uncheck the box). ; Ensure the AutoCAD Page Setup window is the active window. WinActivate("Page Setup -") Sleep(10) ; Send Alt-x to plot extents, and put a check in the center plot checkbox. Send("!X!C{+}")The dialog for 2005 uses a popup list for the "Plot Area", so be prepared to revise you script to use Send("!wE") to select Extents. <{POST_SNAPBACK}>
-
Thanks phillip! I'll give it a try when I get a free moment. I'll PM you or repost in the Support Forum if I need any additional help. This was my first post and I didn't know if this was the right forum to post my question, so I apologize for the mix up. Thanks again!
-
Thanks fi3l2! I'll give it a try when I get an opportunity.
-
-
So far so good. Runs great! At first I was thinking the $x = $x + 1 goes within the the second If but after testing and re-testing I eventually figured it out. Much appreciated! Here is the final code. Do $x = InputBox("Question","How many Layout Tabs are there?Include Model Tab") If @error = 1 then ExitLoop; cancel was pressed $x = $x + 1 Until StringIsDigit($x) And $x > 0; keep looping until we get a numerical answer greater than zero. If $x >= 1 then For $loop = 1 to $x Send("!{TAB}^{PGDN}",0) Send("pagesetup {ENTER}") Next EndIf
-
I am running into a slight snag when I compile this as a *.exe file. The snag is....say I have 3 layout tabs in a drawing (this includes the Model Tab) I have to insert the number "4" when Prompted for the amount of Layout Tabs in order for the 'pagesetup' and 'Enter' to work on the last layout tab. So it looks like I need to figure out how I can have the program automatically add 1 to the amount the user inputs at the Prompt or I need to figure out why this code is acting the way it is.
-
phillip123adams, Thank you for your help! I am currently using AutoCAD 2004. There is a known existing bug in 2004 that after a user imports a page setup (via pagesetupin) and sets the current page setup for all the layout tabs that the drawing (in my case the Title Block) is not centered on the page (layout), even if the Plot Offset checkbox to center the plot is checked. To solve this problem the user then has to go through each layout tab, type in pagesetup on the command line and either click the 'OK' button or even simpler just hit the the 'Enter' key. It gets pretty boring and cumbersome when, and if, there are hundreds of layout tabs. I have tried to solve this problem through Scripts and Lisps but for some reason I could never get the Script or Lisp to simulate either the 'OK' button or 'Enter' key while in the page setup dialog box. Supposedly Autodesk solved the Plot Offset to center issue in the 2005 release but the company I work for won't upgrade. Anyway, thanks to Blue_Drache's help I am able to work around the issue. My hats off to all of you programmers. I have a lot to learn.
-
Oh, this is the final code if anyone should need it. Do $x = InputBox("Question","How many Layout Tabs are there? Including the Model Space Tab") If @error = 1 then ExitLoop; cancel was pressed Until StringIsDigit($x) And $x > 0; keep looping until we get a numerical answer greater than zero. If $x >= 1 then For $loop = 1 to $x Send("!{TAB}^{PGDN}",0) Send("pagesetup {ENTER}") Next EndIf
-
Blue_Drache, I finally had some time to try the rest of the code. It works great! You are awesome! I can't thank you enough. I am starting to understand this a little more. It just takes time.........which everyone seems to have little of these days. The reason I wanted to have something like this is because there is an Existing bug within the page setups in AutoCAD 2004 and this helps me to work around it, especially when there are hundreds of layouts per drawing file. Do you have any AutoCAD experience? It seems to me that the AutoIt online documentation is not very clear at times. Are there any books/ebooks or online websites that makes this coding a little easier to understand? Thanks again for all your help! WashCaps37
-
I think of an example of a layout is pretty much like a page in a book. I have a book (drawing file) and it contains many pages (layouts). Layouts pretty much contain a Title Block with all the information regarding the drawing (i.e. Drawing Name, Number, Company Logo, Company Address & Phone Number, etc.) and within that Title Block there may be a Viewport which displays the actual drawing. Hope that helps.
-
Blue_Drache, Just brainstorming here, Is there a way to prompt the user at the beginning of the script for the amount of layouts? that way the program knows how many layouts there are? or would that be asking too much for AutoIt to do? especially if the script will be turned into an exe file.
-
Blue_Drache, Thank you so much for your help! I tried your suggestions and got it to work. I had been racking my brain trying to figure it out. I was trying to learn from the help files and the online documentation. I really do appreciate you taking the time to help me out. Your explainations make understanding looping a lot easier. Thanks again!!!!!!
-
-
Please excuse my lack of scripting knowledge for I am new at scripting and just learning. How would I loop the following with a continuous loop? Send("!{TAB}") Send("{CTRLDOWN}") Send("{PGDN}") Send("{CTRLUP}") Send("pagesetup {ENTER}") What I am trying to accomplish is for this to go into AutoCAD, run the pagesetup command then go to the next layout tab and repeat the process until all of the layout tabs have been cycled through. For some wierd reason, AutoCAD won't accept commands through a *.scr or *.lsp file to activate the enter key or ok button in the page setup dialog box so I am trying to perfom the actions that I need done with AutoIt. I have tried the If.....Then with ContinueLoop command, Do...Until with Continue Loop command and While....Until with Continue Loop command and nothing seems to be working. I don't understand what I am missing. Just in case you didn't already know this about AutoCAD, the CTRLDOWN, PGDN, CTRLUP commands allows AutoCAD to go to the next layout. Thanks for your help!
-
I guess I could convert it to an AutoLISP and try and execute it from the *au3 file. Would the "Send" command work in this case?
-
Do you have any suggestions/ideas on how I would be able to get this to work (execute the *.scr file) from a *.au3 script file?
-
Hello All - I am new to this scripting so please forgive me. I am trying create a script that will eventually run an AutoCAD Script file but I keep running into an AutoIT Error message that states: Unable to execute the external program. The system cannot find the path specified. I have the correct path in the *au3 file. Does anyone know what I am doing wrong on this line of the script? (see below) run("L:\\Cad_Library\Bonus_Tools\Scripts\Cycle Layouts.scr") Any and all help is greatly appreciated!