Jump to content

Need help with Looping


Recommended Posts

I am trying to incorporate more commands once I am in the pagesetup. For example, once I am on the pagesetup screen I would like to do an Alt x and an Alt c before hitting the Enter key. The Alt x and Alt c check an "Extents" checkbox or actually a check circle and Alt c puts a check in a center plot checkbox. If I run *.au3 file with just these commands and it wil work.

<{POST_SNAPBACK}>

Phillip

Link to comment
Share on other sites

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

Link to comment
Share on other sites

From what I remember, the Setup Dialog is virtually the same in 2002 & 2004. Does 2002 have any problems the plot offset or centering the drawing on the layout tab after setting the page setup?

Thanks for the heads up on 2005.  I heard 2005 has a lot of bugs. Would you recommend it?

<{POST_SNAPBACK}>

I can't recommend AutoCAD 2005 one way or the other. While I have it, I haven't used it very much as all of my clients are still using 2002. But I tested/ported all of my AutoLisp programs to it a year ago, and they all work.

In 2002, I have not seen any problem with centering the plot, but most of my plots are from Model Space and are done automatically via AutoLisp which may prevent me from noticing as it sets all plot parameters. The few drawings I plot as Layouts are drawings from others and I rarely pay much attention to their quality (I'm sure you know how that is). While working on this script, all layouts have appeared to center correctly (at least in the screen preview).

I finally understand what "^{PGDN}" does! Earlier, I read your description, but could not get it to work. The reason it didn't work is because it does not work in ACAD 2002. I tried it in 2005 and it cycled to the next layout. But I still don't know what "!{TAB}" does in your script.

I have a few questions about your script, and based upon the way I see it, I have redone the script (see below) to address those issues.

1. How do you know which Layout tab is current? The Model tab must be current in order to process all Layouts using ^{PGDN} as it stops on the right most tab (at least in 2005).

2. I don't see a WinActivate("AutoCAD") statement which would activate the AutoCAD window before sending commands to AutoCAD. What ensures AutoIt sends to the AutoCAD command line?

3. What ensures the current tab of the PageSetup Dialog is the Layout Settings tab? If it's not, sending keys to pick the Extents button and Center Plot check box will fail.

I tested my version in 2002 and, by your notation, I assume it will work for 2004. The only problem I see is in how long the AutoIt script should sleep while AutoCAD regenerates the drawing each time another layout tab is made active (there is a variable where that can be adjusted easily).

My script eliminates the need for the user input of the number of layouts as it gets a list of layout names from AutoLisp. It also does not use ^{PGDN} to change tabs, rather it uses AutoLisp which seems to work more reliably, works with ACAD 2002, and ensures all Layout tabs and the Model tab are processed. The only thing I don't like is it processes the tabs in alphabetical order, rather than left to right, as that's the way AutoLisp returns their names.

Feel free to toss it, use it, change it, and/or distribute it as you see fit.

; Note: Tested in AutoCAD 2002 only, but should work in 2004, but not 2005.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;; Allow sufficient time for the layout tab to change to the next or
;; previous tab.  Too short of a period and the script will get out
;; of sync with the Layout tab changes.  Tests indicate this value
;; should be at least 250.
Global $iTabChangeDelay = 300
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED

; Adjust AutoIt speed controls
OPT ("SENDKEYDELAY", 2)
OPT ("WinWaitDelay", 50)

; The tooltip location
Global $iX1 = Int(@DesktopWidth / 2)
Global $iY1 = Int(@DesktopHeight / 2) + 75

; Activate the AutoCAD window
If WinExists("AutoCAD") Then
   WinActivate("AutoCAD")
   WinWaitActive("AutoCAD", "", 10)
Else
   MsgBox(4096, "No AutoCAD window", "AutoCAD is not running.  This script requires it.  This script will exit.")
   Exit
EndIf

; Block input to keep the user from fouling up the script while it runs.
; Ctrl-Alt-Del will reinstate the input devices but should be
; used only if absolutely necessary. See help file for more info.
BlockInput(1)
SplashTextOn("Adjusting Page Setups", "Mouse and Keyboard are deactivated while doing Page Setups" & @LF & @LF & "This message will disappear when complete", 500, 80)

; Remember the name of the current layout tab
Sleep(10)
Send('(setq Orig-Ctab (getvar "CTAB")) ')

; Automatically obtain the names of all Layouts in the current AutoCAD drawing,
; (except Model tab) which will be use by this script to loop through all layout tabs.
; A temporary text file is used to pass the layouts names to AutoIt.
$sFname1 = @TempDir & '\LayoutNames.txt' 
; Double backslashes required for AutoCAD
$sFname2 = StringReplace($sFname1, "\", "\\")
; Send AutoLisp statements to the AutoCAD command line.
Sleep(10)
Send('(setq fn1 (Open "' & $sFname2 & '" "w")) ')
Sleep(10)
Send('(setq LayoutNames "") ', 1)
Sleep(10)
Send('(Foreach xx1 (layoutlist) (setq LayoutNames (strcat LayoutNames "," xx1))) ', 1)
Sleep(10)
Send('(write-line LayoutNames fn1) ', 1)
Sleep(10)
Send('(setq fn1 (close fn1)) ')
Sleep(250)
; Read the layout names from the temp file, stripping the leading comma at the same time.
$sLayoutNames = StringMid(FileReadLine($sFname1), 2)
FileDelete($sFname1)
; Convert the Layout names to an array
$asLayoutNames = StringSplit($sLayoutNames, ",")
; Add the Model tab to the list at indices zero.
$asLayoutNames[0] = "Model" 


; Cycle through the layout tabs, adjusting the page setup for each.
; Except for Model (done first), the tabs are processed alphabetically
; because that's how the Layout name list comes from AutoLisp.
$iX = UBound($asLayoutNames)
For $loop = 0 To $iX - 1
   $ThisLayoutName = $asLayoutNames[$loop]
   ToolTip("Tabbing... (" & $loop & " of " & $iX & ") " & @LF & $ThisLayoutName, $iX1, $iY1)
  ; Change to the layout tab to be processed
   Sleep(10)
   Send('(setvar "CTAB" "' & $ThisLayoutName & '") ')
  ; Wait while AutoCAD regenerates after switching Layout tabs.
   Sleep($iTabChangeDelay)
   
  ; Open the AutoCAD Page Setup dialog
   Send("pagesetup ")
  ; Ensure the Page Setup dialog opens and is the active window.
   Sleep(10)
   WinActivate("Page Setup ")
   WinWaitActive("Page Setup ")
   Sleep(10)
  ; Ensure the Layout Settings Tab is active
   Send("!U{TAB}{TAB}{TAB}{RIGHT}")
  ; Send Alt-x to Plot Extents, and put a check mark in the Center Plot checkbox.
  ; Note: The drawing must contain at least one displayed object or the Extents radio
  ;    button is not enabled and a beep will sound.
   Sleep(10)
   Send("!X!C{+}")
  ; Close the Page Setup dialog
   Sleep(10)
   Send("{ENTER}")
   Sleep(50)
Next; $loop
ToolTip("")
SplashOff()
; Reactive the original Layout tab.
Send('(setvar "CTAB" Orig-Ctab) ')
Exit

PS: I avoid the use of Paper Space (Layouts) whenever I can. When AutoLisp made its debut (long before Paper Space), I wrote programs to support multi-scale details in a single drawing as well as multiple drawings in a single drawing file (all in Model Space, all visible all the time at their proper size, and all editable at the same time). Most of the time when I go to Paper Space its because that's the only place the SOLPROF command will work. When a client requires delivery in Paper Space, I run a program that automatically creates the viewports in Layout1 from the various details, border and title block which reside in Model Space.

Phillip

Link to comment
Share on other sites

I finally understand what "^{PGDN}" does!  Earlier, I read your description, but could not get it to work.  The reason it didn't work is because it does not work in ACAD 2002.  I tried it in 2005 and it cycled to the next layout.  But I still don't know what "!{TAB}" does in your script.

I first started using "!{TAB" because when I was testing the script I had to click on the AutoCAD 2004 on the task bar then Click on the Window Explorer on the task bar and run the script. "!{TAB}" would then switch back to AutoCAD and run the script. I admit I didn't really know what I was doing because I am new at this coding.

I have a few questions about your script, and based upon the way I see it, I have redone the script (see below) to address those issues.

1.  How do you know which Layout tab is current?  The Model tab must be current in order to process all Layouts using ^{PGDN} as it stops on the right most tab (at least in 2005).

I made a Button Macro in AutoCAD that would switch to Model Space before performing the compiled script.

^C^Cctab;Model;(startapp "L:/CAD_Library/EDS-Bonus_Tools/Scripts/Enter.exe" ) 

2.  I don't see a WinActivate("AutoCAD") statement which would activate the AutoCAD window before sending commands to AutoCAD.  What ensures AutoIt sends to the AutoCAD command line?

At the time I wasn't aware of what WinActivate("AutoCAD") does. I am still learning.

3.  What ensures the current tab of the PageSetup Dialog is the Layout Settings tab?  If it's not, sending keys to pick the Extents button and Center Plot check box will fail.

WinActive("Page Setup -")

This is/was my final version until I tried your code:

Do

   $x = InputBox("Question","How many Layout Tabs are there?")

      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. 

   $x=$x+1

If $x >= 1 then

   For $loop = 1 to $x

   Opt("SendKeyDelay",25)

   Send("pagesetup{enter}",0)

   WinActive("Page Setup -")

   Sleep(20)

   Send("!x!c{+}{enter}",0)

   WinActive("AutoCAD 2004 -")

   Sleep(20)

   Send("_.MSPACE{enter}",0)

   Send("psltscale{enter}",0)

   Send("{0}{enter}",0)

   Send("_.PSPACE{enter}",0)

   Sleep(10)

   Send("regenall{enter}",0)

   Sleep(30)

   Send("z{enter}",0)

   Send("e{enter}",0)

   WinActive("AutoCAD 2004 -")

   Sleep(10)

   Send("^{PGDN}",0)

   WinActive("AutoCAD 2004 -") 

   Next

EndIf

Feel free to toss it, use it, change it, and/or distribute it as you see fit.

; Note: Tested in AutoCAD 2002 only, but should work in 2004, but not 2005.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;; Allow sufficient time for the layout tab to change to the next or
;; previous tab.  Too short of a period and the script will get out
;; of sync with the Layout tab changes.  Tests indicate this value
;; should be at least 250.
Global $iTabChangeDelay = 300
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED

; Adjust AutoIt speed controls
OPT ("SENDKEYDELAY", 2)
OPT ("WinWaitDelay", 50)

; The tooltip location
Global $iX1 = Int(@DesktopWidth / 2)
Global $iY1 = Int(@DesktopHeight / 2) + 75

; Activate the AutoCAD window
If WinExists("AutoCAD") Then
   WinActivate("AutoCAD")
   WinWaitActive("AutoCAD", "", 10)
Else
   MsgBox(4096, "No AutoCAD window", "AutoCAD is not running.  This script requires it.  This script will exit.")
   Exit
EndIf

; Block input to keep the user from fouling up the script while it runs.
; Ctrl-Alt-Del will reinstate the input devices but should be
; used only if absolutely necessary. See help file for more info.
BlockInput(1)
SplashTextOn("Adjusting Page Setups", "Mouse and Keyboard are deactivated while doing Page Setups" & @LF & @LF & "This message will disappear when complete", 500, 80)

; Remember the name of the current layout tab
Sleep(10)
Send('(setq Orig-Ctab (getvar "CTAB")) ')

; Automatically obtain the names of all Layouts in the current AutoCAD drawing,
; (except Model tab) which will be use by this script to loop through all layout tabs.
; A temporary text file is used to pass the layouts names to AutoIt.
$sFname1 = @TempDir & '\LayoutNames.txt' 
; Double backslashes required for AutoCAD
$sFname2 = StringReplace($sFname1, "\", "\\")
; Send AutoLisp statements to the AutoCAD command line.
Sleep(10)
Send('(setq fn1 (Open "' & $sFname2 & '" "w")) ')
Sleep(10)
Send('(setq LayoutNames "") ', 1)
Sleep(10)
Send('(Foreach xx1 (layoutlist) (setq LayoutNames (strcat LayoutNames "," xx1))) ', 1)
Sleep(10)
Send('(write-line LayoutNames fn1) ', 1)
Sleep(10)
Send('(setq fn1 (close fn1)) ')
Sleep(250)
; Read the layout names from the temp file, stripping the leading comma at the same time.
$sLayoutNames = StringMid(FileReadLine($sFname1), 2)
FileDelete($sFname1)
; Convert the Layout names to an array
$asLayoutNames = StringSplit($sLayoutNames, ",")
; Add the Model tab to the list at indices zero.
$asLayoutNames[0] = "Model" 
; Cycle through the layout tabs, adjusting the page setup for each.
; Except for Model (done first), the tabs are processed alphabetically
; because that's how the Layout name list comes from AutoLisp.
$iX = UBound($asLayoutNames)
For $loop = 0 To $iX - 1
   $ThisLayoutName = $asLayoutNames[$loop]
   ToolTip("Tabbing... (" & $loop & " of " & $iX & ") " & @LF & $ThisLayoutName, $iX1, $iY1)
  ; Change to the layout tab to be processed
   Sleep(10)
   Send('(setvar "CTAB" "' & $ThisLayoutName & '") ')
  ; Wait while AutoCAD regenerates after switching Layout tabs.
   Sleep($iTabChangeDelay)
   
  ; Open the AutoCAD Page Setup dialog
   Send("pagesetup ")
  ; Ensure the Page Setup dialog opens and is the active window.
   Sleep(10)
   WinActivate("Page Setup ")
   WinWaitActive("Page Setup ")
   Sleep(10)
  ; Ensure the Layout Settings Tab is active
   Send("!U{TAB}{TAB}{TAB}{RIGHT}")
  ; Send Alt-x to Plot Extents, and put a check mark in the Center Plot checkbox.
  ; Note: The drawing must contain at least one displayed object or the Extents radio
  ;       button is not enabled and a beep will sound.
   Sleep(10)
   Send("!X!C{+}")
  ; Close the Page Setup dialog
   Sleep(10)
   Send("{ENTER}")
   Sleep(50)
Next; $loop
ToolTip("")
SplashOff()
; Reactive the original Layout tab.
Send('(setvar "CTAB" Orig-Ctab) ')
Exit

<{POST_SNAPBACK}>

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

Edited by WashCaps37
Link to comment
Share on other sites

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.

<{POST_SNAPBACK}>

I'm glad you like the script, it was fun to do. And it's good to know it works in 2004 as well. Now that you have a taste of the power of AutoIt, maybe we'll be seeing some nice AutoIt scripts for AutoCAD from you. And tell your friends too!

One of the hardest things is keeping an AutoIt script in sync with AutoCAD. One little slip and anything can happen. That's why I added the BlockInput statement. But, AutoIt is the best bet when it comes to manipulating dialog boxes, because AutoLisp cannot.

Yep, why not get the script to do everything it possibly can while it cycles through the layouts. I know the drafter will certainly appreciate it. To that end, I updated the script to include the extra AutoCAD stuff that your script was doing. I added another variable to adjust the sleep period while AutoCAD regenerates and zooms. Please adjust it, especially if a longer sleep is desirable. Better to add a couple of extra seconds to the running time and not have any sync problems.

; Note: Tested in AutoCAD 2002 only, but should work in 2004, but not 2005.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;; Allow sufficient time for the layout tab to change to the next or
;; previous tab and for the regeneration and zoom extents commands.
;; Too short of a period and the script will get out of sync with the
;; Layout tab changes.
;; Tests indicate $iTabChangeDelay should be at least 250 milliseconds.
Global $iTabChangeDelay = 300
;; Tests indicate $iRegenDelay should be at least 500 milliseconds.
Global $iRegenDelay = 500
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ADJUST AS REQUIRED

; Adjust AutoIt speed controls
OPT ("SENDKEYDELAY", 2)
OPT ("WinWaitDelay", 50)

; The tooltip location
Global $iX1 = Int(@DesktopWidth / 2)
Global $iY1 = Int(@DesktopHeight / 2) + 75

; Activate the AutoCAD window
If WinExists("AutoCAD") Then
   WinActivate("AutoCAD")
   WinWaitActive("AutoCAD", "", 10)
Else
   MsgBox(4096, "No AutoCAD window", "AutoCAD is not running.  This script requires it.  This script will exit.")
   Exit
EndIf

; Block input to keep the user from fouling up the script while it runs.
; Ctrl-Alt-Del will reinstate the input devices but should be
; used only if absolutely necessary. See help file for more info.
BlockInput(1)
SplashTextOn("Adjusting Page Setups", "Mouse and Keyboard are deactivated while doing Page Setups" & @LF & @LF & "This message will disappear when complete", 500, 80)

; Remember the name of the current layout tab
Sleep(10)
Send('(setq Orig-Ctab (getvar "CTAB")) ')

; Automatically obtain the names of all Layouts in the current AutoCAD drawing,
; (except Model tab) which will be use by this script to loop through all layout tabs.
; A temporary text file is used to pass the layouts names to AutoIt.
$sFname1 = @TempDir & '\LayoutNames.txt'
; Double backslashes required for AutoCAD
$sFname2 = StringReplace($sFname1, "\", "\\")
; Send AutoLisp statements to the AutoCAD command line.
Sleep(10)
Send('(setq fn1 (Open "' & $sFname2 & '" "w")) ')
Sleep(10)
Send('(setq LayoutNames "") ', 1)
Sleep(10)
Send('(Foreach xx1 (layoutlist) (setq LayoutNames (strcat LayoutNames "," xx1))) ', 1)
Sleep(10)
Send('(write-line LayoutNames fn1) ', 1)
Sleep(10)
Send('(setq fn1 (close fn1)) ')
Sleep(250)
; Read the layout names from the temp file, stripping the leading comma at the same time.
$sLayoutNames = StringMid(FileReadLine($sFname1), 2)
FileDelete($sFname1)
; Convert the Layout names to an array
$asLayoutNames = StringSplit($sLayoutNames, ",")
; Add the Model tab to the list at indices zero.
$asLayoutNames[0] = "Model"

; Cycle through the layout tabs, adjusting the page setup for each.
; Except for Model (done first), the tabs are processed alphabetically
; because that's how the Layout name list comes from AutoLisp.
$iX = UBound($asLayoutNames)
For $loop = 0 To $iX - 1
   $ThisLayoutName = $asLayoutNames[$loop]
   ToolTip("Tabbing... (" & $loop & " of " & $iX & ") " & @LF & $ThisLayoutName, $iX1, $iY1)
  ; Change to the layout tab to be processed
   Sleep(10)
   Send('(setvar "CTAB" "' & $ThisLayoutName & '") ')
  ; Wait while AutoCAD regenerates after switching Layout tabs.
   Sleep($iTabChangeDelay)

  ; Open the AutoCAD Page Setup dialog
   Send("_.pagesetup ")
  ; Ensure the Page Setup dialog opens and is the active window.
   Sleep(10)
   WinActivate("Page Setup ")
   WinWaitActive("Page Setup ")
   Sleep(10)
  ; Ensure the Layout Settings Tab is active
   Send("!U{TAB}{TAB}{TAB}{RIGHT}")
  ; Send Alt-x to Plot Extents, and put a check mark in the Center Plot checkbox.
  ; Note: The drawing must contain at least one displayed object or the Extents radio
  ;    button is not enabled and a beep will sound.
   Sleep(10)
   Send("!X!C{+}")
  ; Close the Page Setup dialog
   Sleep(10)
   Send("{ENTER}")
  ; Set PSLtscale for Model and Paper Spaces, regen everything and zoom extents in Paper Space.
  ; Note: AutoCAD rejects some of the following in Model Space, but so what, it doesn't hurt anything.
   Send('(progn (command "_.MSPACE")(setvar "psltscale" 0)(command "_.PSPACE")(command "_.regenall")(command "_.zoom" "e")) ')
  ; Wait while AutoCAD regenerates and zooms.
   Sleep($iRegenDelay)
Next; $loop
ToolTip("")
SplashOff()
; Reactive the original Layout tab.
Send('(setvar "CTAB" Orig-Ctab) ')
Exit

PS: In 2000, there are 2 tabs in the Page Setup dialog (Plot Device and Layout Settings). The default tab is the one last used in the last drawing it was used. That's why I asked what ensured the Layout Settings tab is active. Is the dialog different in 2004?

Phillip

Link to comment
Share on other sites

  • 5 years later...

Did you want X and C or X and Y? Getting your variables mixed up with your cartiesian coordinates?

Anyway.... There should be no reason why these shouldn't work. You must make sure that the AutoCAD window is active before sending anything.

Try putting a WinActivate() command just before the send, and try condensing.... you don't have to write each command one per line.

Send("pagesetup!x!c{enter}",0) is perfectly valid, providing you're sending it to the correct window.

Also, check your send-key delay. AutoIt may be sending too fast for the program to pick up the strokes. Increase the delay between keystrokes with Opt("SendKeyDelay",100). This will put a hefty delay in (100 ms) inbetween each keystroke, so it may appear sluggish.

Remember, when sending in mode zero:

! = alt

^ = ctrl

+ = shift

# = Windows Key

Check out the "Send Key List" in the help file.

amazing, if only could pull this off sing VBA or something alike.I'm using ACAD2006.

Awsome work man

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...