Rmedina4 Posted June 28, 2017 Share Posted June 28, 2017 (edited) Hello Everyone, Here is my code, it works perfectly but now I'm trying to have $test be changed after every loop. For example, I have this text file with a list of different part numbers and I want it to do all the steps in my script but instead of it doing it for SOT323.PRT every time I want the $test to be populated to "a New part from my text file" and loop thru all the parts. Note: there is like 400+ parts in this text file. Can someone help me with the last step so I can be finished? Thank you in advance!!! expandcollapse popupAutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) Local $i = 1 Do WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(2000) MouseClick('primary', 1300, 292, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; $test = "SOT323.PRT" ClipPut($test) Send('^v') Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(4000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 372, 595, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(4000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 312, 366, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button, scroll ; down, right, enter then it will open in Creo and populate the 3D model ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(5000) Send('{DOWN}') Send('{RIGHT}') sleep(4000) Send("{ENTER}") Sleep(7000) Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MouseClick('Primary', 610, 84, 1, 0) Sleep(4000) Send('{DOWN 4}') Sleep(4000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(4000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinWait("Creo Parametric") WinActivate("Creo Parametric") Send("qq") Sleep(4000) Send("ss") ;This will make it repeat til i reaches 3 $i = $i + 1 Until $i = 3 Edited June 28, 2017 by JLogan3o13 Link to comment Share on other sites More sharing options...
Subz Posted June 28, 2017 Share Posted June 28, 2017 (edited) Try this: expandcollapse popupAutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) Global $sParts = @ScriptDir & "\Parts.txt" ;~ String Variable pointing to Parts.txt file Global $aParts ;~ Array Variable _FileReadToArray($sParts, $aParts) For $i = 1 To $aParts[0] WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(2000) MouseClick('primary', 1300, 292, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClipPut($aParts[$i]) Send('^v') Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(4000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 372, 595, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(4000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 312, 366, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button, scroll ; down, right, enter then it will open in Creo and populate the 3D model ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(5000) Send('{DOWN}') Send('{RIGHT}') sleep(4000) Send("{ENTER}") Sleep(7000) Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MouseClick('Primary', 610, 84, 1, 0) Sleep(4000) Send('{DOWN 4}') Sleep(4000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(4000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinWait("Creo Parametric") WinActivate("Creo Parametric") Send("qq") Sleep(4000) Send("ss") ;This will make it repeat til i reaches 3 Next Edited June 28, 2017 by Subz Rmedina4 1 Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 I tried it doesn't seem to work. my text file location is in "C:\Users\rmedina\Documents\" both my script and my txt file. Idk if I'm doing something wrong but also it doesn't to like the _FileReadToArray($sParts, $aParts) I tried fixing the problem myself but doesn't seem to work with anything I do. Also, thank you for helping Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2017 Developers Share Posted June 28, 2017 2 minutes ago, Rmedina4 said: but also it doesn't to like the _FileReadToArray($sParts, $aParts) Check the helpfile for the proper #include file to add which is currently missing in the code. Jos Rmedina4 1 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 Thank you, I added #include <File.au3> and #include <Array.au3> to the top of my code right now. Seems like my array is messed up? The bottom picture is my parts list text file just FYI I never posted my txt file on the thread. Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2017 Developers Share Posted June 28, 2017 This means that the input file isn't found. where is it located? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 28, 2017 Moderators Share Posted June 28, 2017 @Rmedina4 you will make it much easier for us to help you if you post files, not pictures. That way we can duplicate your efforts, without having to retype a bunch of text. "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 @Joslocated in C:\Users\rmedina\Documents\Symbol-look-with-prt.txt Thank you @JLogan3o13 this is my code. Test-Script.au3 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 28, 2017 Moderators Share Posted June 28, 2017 I meant the text file you are pulling from. For code, in the future, just use the code tags <> when you post. I updated your first post so you can see how it looks. Rmedina4 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 C:\Users\rmedina\Documents\Symbol-look-with-prt.txt is where my the text file is stored on my computer. Symbol-look-with-prt.txt Link to comment Share on other sites More sharing options...
Developers Jos Posted June 28, 2017 Developers Share Posted June 28, 2017 ... and your script is trying to read it from the directory the script is located in.... right? Is that correct? Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 That's correct. Both my script and my text file are both in C:\Users\rmedina\Documents\ Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted June 28, 2017 Moderators Share Posted June 28, 2017 (edited) @Rmedina4 based on the script file you uploaded, you have this line: Global $sParts = @ScriptDir & "C:\Users\rmedina\Documents\Symbol-look-with-prt.txt" Try doing this, and you will see why that line is your problem: ConsoleWrite(@ScriptDir & "C:\Users\rmedina\Documents\Symbol-look-with-prt.txt" & @CRLF) Edited June 28, 2017 by JLogan3o13 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 (edited) - Edited June 29, 2017 by Rmedina4 Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 expandcollapse popup#include <File.au3> #include <Array.au3> AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) ;Global $sParts = @ScriptDir & "C:\Users\rmedina\Documents\Symbol-look-with-prt.txt" ;~ String Variable pointing to Parts.txt file ConsoleWrite(@ScriptDir & "C:\Users\rmedina\Documents\Symbol-look-with-prt.txt" & @CRLF) Global $aParts ;~ Array Variable _FileReadToArray($sParts, $aParts) For $i = 1 To $aParts[0] WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(2000) MouseClick('primary', 1300, 292, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ClipPut($aParts[$i]) Send('^v') Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(4000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 372, 595, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(4000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 312, 366, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button, scroll ; down, right, enter then it will open in Creo and populate the 3D model ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(5000) Send('{DOWN}') Send('{RIGHT}') sleep(4000) Send("{ENTER}") Sleep(7000) Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MouseClick('Primary', 610, 84, 1, 0) Sleep(4000) Send('{DOWN 4}') Sleep(4000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(4000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; WinWait("Creo Parametric") WinActivate("Creo Parametric") Send("qq") Sleep(4000) Send("ss") Next Error: Link to comment Share on other sites More sharing options...
RTFC Posted June 28, 2017 Share Posted June 28, 2017 (edited) You followed JLogan3013's suggestion, but you apparently didn't study the output very carefully. It's right here: 21 minutes ago, Rmedina4 said: Global $sParts = @ScriptDir & "C:\Users\rmedina\Documents\Symbol-look-with-prt.txt" The macro (@scriptDir) already produces the entire path, and then you immediately append drive and path again, which obviously won't yield a valid location. I guess JLo was hoping you would discover this when writing it out to console (it's one line above the error message in your last screen capture). So re-enable the $sParts declaration (commented out in last example), and either use macro & "\" & filename or supply the full path+filename yourself, but not both. Edited June 28, 2017 by RTFC My Contributions and Wrappers Spoiler BitMaskSudokuSolver BuildPartitionTable CodeCrypter CodeScanner DigitalDisplay Eigen4AutoIt FAT Suite HighMem MetaCodeFileLibrary OSgrid Pool RdRand SecondDesktop SimulatedAnnealing Xbase I/O Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 Thank you, yeah I figured it out like 5 mins ago but I'm running it to see if the script does what I need it to do. seems like it doesn't pull in the parts from the files now Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 28, 2017 Author Share Posted June 28, 2017 Thank you, everyone, my script works the way I want it to. Special thanks to @RTFC @JLogan3o13 @Jos @Subz !!!!! Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 29, 2017 Author Share Posted June 29, 2017 is there a way for me to activate this window even though the name will be changed every time when it loops to a new part? I'm trying to click the edit button. this takes place in the "click on edit then click del entire FT, press enter" section of the code expandcollapse popup#include <File.au3> #include <Array.au3> #RequireAdmin AutoItSetOption('MouseCoordMode', 0) AutoItSetOption('SendKeyDelay', 7) Global $sParts = @ScriptDir & "\Symbol-look-with-prt.txt" ;~ String Variable pointing to Parts.txt file Global $aParts ;~ Array Variable _FileReadToArray($sParts, $aParts) For $i = 1 To $aParts[0] WinWait("Creo Parametric") WinActivate("Creo Parametric") sleep(2000) MouseClick('primary', 1300, 292, 1, 0) ;**************************************************************************************** ;This part of the code is for assigning a var to a part ;it stores the var then paste it into the search field and hits enter ; ;**************************************************************************************** ClipPut($aParts[$i]) Send('^v') Send("{ENTER}") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will show the results of ; the ClipPut ("Value") and will show the part in PDP ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 372, 595, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) WinWait("Creo Parametric") WinActivate("Creo Parametric") MouseClick('primary', 312, 366, 1, 0) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in PDP and will click on the Action button, scroll ; down, right, enter then it will open in Creo and populate the 3D model ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; sleep(9000) Send('{DOWN}') Send('{RIGHT}') sleep(9000) Send("{ENTER}") Sleep(7000) Send("{ENTER}") Sleep(9000) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and will click on the X button To ; Close the current window another way to do this is WinClose funtion ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; MouseClick('Primary', 610, 84, 1, 0) Sleep(9000) Send('{DOWN 4}') Sleep(9000) Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") WinWaitActive("Parameter Status",'') Send("{ENTER}") Sleep(9000) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; This part of the code executes in Creo and bring back the PDP search link ; Make sure to have MapKey created in Creo call it qq so when its called ; it will close the object in creo ; ; Another Mapkey that needs to be created is ss so it can bring up the PDP search ; site. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; tools --> FT MouseClick('Primary', 479, 53, 1, 0) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") MouseClick('Primary', 541, 102, 1, 0) ; click on edit then click del entire FT, press enter WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 671, 206, 1, 0) Send('{DOWN 13}') Sleep(9000) Send("{ENTER}") Sleep(9000) ;confirm del of FT WinWait("Confirm") WinActivate("Confirm") MouseClick('Primary', 927, 430, 1, 0) Sleep(9000) ;empty FT window clicking ok button WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 1193, 605, 1, 0) Sleep(9000) ; nv tool tab WinWaitActive("[CLASS:Dialog]") MouseClick('Primary', 122, 53, 1, 0) Sleep(9000) ; this part is for the "Generate family table Columns" MouseClick('Primary', 610, 84, 1, 0) Sleep(9000) Send('{DOWN}') Sleep(9000) Send("{ENTER}") Sleep(9000) ;autoload data MouseClick('Primary', 610, 84, 1, 0) Sleep(9000) Send('{DOWN 2}') Sleep(9000) Send("{ENTER}") Sleep(9000) ; tools--> FT MouseClick('Primary', 479, 53, 1, 0) WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") MouseClick('Primary', 541, 102, 1, 0) Sleep(9000) ; click ok on open FT window WinWait("[CLASS:Dialog]") WinActivate ("[CLASS:Dialog]") MouseClick('Primary', 1443, 603, 1, 0) sleep(9000) ;close object window Send("qq") Sleep(9000) ; open up the PDP search window Send("ss") Next Thank you in advance! Link to comment Share on other sites More sharing options...
Rmedina4 Posted June 29, 2017 Author Share Posted June 29, 2017 The basic window info will change every time Example since CAP_SMD_3528.PRT is the part pulled from the text file the new part after it loops will be SOT_232.PRT is there a way I can use the name pulled from the text file but for it to not include the .PRT Every time this window open up the basic window info will be Title: Family Table: Part name without the .PRT Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now