Rmedina4

File looping (HELP)

39 posts in this topic

#1 ·  Posted (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!!!

AutoItSetOption('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 by JLogan3o13

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Try this:

AutoItSetOption('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 by Subz
1 person likes this

Share this post


Link to post
Share on other sites

#3 ·  Posted

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

 

2017-06-28_11-26-27.jpg

2017-06-28_11-29-26.jpg

Share this post


Link to post
Share on other sites

#4 ·  Posted

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

1 person likes this

Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#5 ·  Posted

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.

2017-06-28_11-34-14.jpg

2017-06-28_11-36-57.jpg

Share this post


Link to post
Share on other sites

#7 ·  Posted

@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.


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#8 ·  Posted

@Joslocated in C:\Users\rmedina\Documents\Symbol-look-with-prt.txt

Thank you @JLogan3o13 this is my code. 

Test-Script.au3

Share this post


Link to post
Share on other sites

#9 ·  Posted

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.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#10 ·  Posted

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

Share this post


Link to post
Share on other sites

#11 ·  Posted

... and your script is trying to read it from the directory the script is located in.... right?  Is that correct?

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

#12 ·  Posted

That's correct. Both my script and my text file are both in  C:\Users\rmedina\Documents\

Share this post


Link to post
Share on other sites

#13 ·  Posted (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 by JLogan3o13

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#14 ·  Posted (edited)

-

Edited by Rmedina4

Share this post


Link to post
Share on other sites

#15 ·  Posted

#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:

2017-06-28_13-22-24.jpg

Share this post


Link to post
Share on other sites

#16 ·  Posted (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 by RTFC

Share this post


Link to post
Share on other sites

#17 ·  Posted

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

Share this post


Link to post
Share on other sites

#18 ·  Posted

Thank you, everyone, my script works the way I want it to. Special thanks to @RTFC @JLogan3o13 @Jos @Subz !!!!!

Share this post


Link to post
Share on other sites

#19 ·  Posted

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

#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! 

2017-06-29_11-09-29.jpg

Share this post


Link to post
Share on other sites

#20 ·  Posted

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

Share this post


Link to post
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