DaTommyboY
Programmer
Hello peoples,
I am working on a peace of code to automaticly startup a 3D drawing program, start a new drawing and past automatisch about 100 curves. You probebly see my problem, 100 curves is LOT of work.
My idea was to use SendKeys(), however I have to wait till the action of my Keys are actualy carryed out. Therefore is the SendKeysWait() function, according to the maniual. However, my VB program does not support that function!!! Any help would be nice.
My code
on a module
on a form
PS i use a dirlistbox to determin in with folder the curves are saved!!
****** Tractor Pulling ******
The most powerfull motorsport
in the world!!!
I am working on a peace of code to automaticly startup a 3D drawing program, start a new drawing and past automatisch about 100 curves. You probebly see my problem, 100 curves is LOT of work.
My idea was to use SendKeys(), however I have to wait till the action of my Keys are actualy carryed out. Therefore is the SendKeysWait() function, according to the maniual. However, my VB program does not support that function!!! Any help would be nice.
My code
on a module
Code:
Option Explicit
Public ReturnValue As String
Public QQ As Integer
Public RR, TT As String
Public SS, UU As Integer
on a form
Code:
Private Sub Command1_Click()
SS = Val(Text2.Text)
TT = 1 'naam curve
ReturnValue = Shell("c:\program files\solidworks\sldworks.exe", 1) ' Run Solid Works
Debug.Print ReturnValue
AppActivate "Solidworks" ' Activate Solid works.
'AppActivate ReturnValue ' Activate Solid works.
Debug.Print ReturnValue
SendKeys "(^N)", True 'aanmaken nieuwe tekening
SendKeys "~", True 'enter doorsturen om nieuwe tekening te bevestigen
For UU = 1 To SS 'times to repeat(number of curves to insert)
SendKeys "%+I", True 'pull down INSERT menu openen
For QQ = 1 To 3
SendKeys "{down}", True '3 x pijl omlaag
Next QQ
SendKeys "{right}", True '1 x pijl rechts
For QQ = 1 To 5
SendKeys "{down}", True '5 x pijl omlaag
Next QQ
SendKeys "~", True
For QQ = 1 To 2
SendKeys "{tab}", True '2 x tab
Next QQ
SendKeys "~", True
RR = Text1.Text + "\" + TT + ".sldcrv"
TT = TT + 1
SendKeys TT, True 'naam en pad doorsturen van in te voegen curve
SendKeys "~", True
SendKeys "{tab}", True '1 x tab
SendKeys "~", True
Next UU
MsgBox ("Inserting the curves in done, nice!!")
End Sub
PS i use a dirlistbox to determin in with folder the curves are saved!!
****** Tractor Pulling ******
The most powerfull motorsport
in the world!!!