How are you referring to the path of the file Stations.pdi? One difference in PI Processbook and PI ActiveView usage might be the paths. Can you confirm that d1 actually gets assigned to the desired pdi file to begin with? Are you able to manipulate anything in the file or on the screen using object d1?
I am sure that d1 gets assigned to the desired .pdi file. Here is how I define the path:
PathArray = Split(ThisDisplay.Path, "\")
Length = UBound(PathArray)
PathArray(Length) = ""
FolderPath = Join(PathArray(), "\")
So FolderPath & "Stations.pdi would be my full path to the .pdi file. Everything works fine using this method within Processbook. (I have to assign the stationNumbers to the Stations.pdi file since everything in the Stations.pdi file is element relative, and everything changes according to that stationNumber, including some of the layout for the screen).So I am pretty sure the variable got passed.
And when I use ActiveView, I changed the path to just
Set d1 = Application.Displays.Open("Stations.pdi", True) Note that I got rid of the "folderpath" in front of the "stations.pdi", since by default, the html opens the .pdi files within the same folder. (But in Processbook I have to specify the path as well as the file name)
So in ActiveView, the Stations.pdi file can be opened no problem, it's just that the StationNumber is not being passed successfully anymore.
Hope I explained it correctly,
Thanks a lot for your help!
John, thanks very much for your detailed response. Just for the sake of a quick test, can you include the full path in your ActiveView code to see if that makes any difference. My goal is to rule out the possibility of any path misconfiguration.
Hi Ahmad, thanks a lot for your reply. Actually I always used the full path before I put everything on the server. So before putting the folder containing all the files to the server, everything was local and I had to use the full path for my program to work, but d1.stationNumber still could not get assigned to the desired .pdi file (but the ProcessBook version did).
Thanks again for your response, really appreciate your help.