I am pretty new in this community.
I have created a new menu in Xpedition Designer (Xpedition Enterprise X-ENTP VX.2.3) for sending the created text files for further processing. For this I should be able to figure out the current project's file path. I have tried a couple of different ways trying to extract this information from sample codes I have found here, but without any success. Once I got error message that the "path" property is obsoleted, other times I got empty string for the path.
My script is something like this (trying to display the path, but an empty string shows up where I expect this path):
Scripting.DontExit = True
'Set pcbApp = GetMGCObject("MGCPCB.ExpeditionPCBApplication")
Set pcbApp = GetObject("","Viewdraw.Application")
Dim strPrjFile : strPrjFile = pcbApp.GetProjectData.GetProjectFilePath
' Get the active document
Set pcbDoc = getDocument(pcbApp)
' CheckIn Design command
if pcbApp is nothing then
MsgBox "Cannot find Application!"
MsgBox "Testing... " & strPrjFile
'Set pcbDoc = getDocument(pcbApp)
'if pcbDoc is nothing then
' MsgBox "Cannot find the Active Document!"
' MsgBox "Testing... " & strPrjFile
Private Sub main()
' Calling CallSubMenu2
Public Function getDocument(appObj)
On Error Resume next
Set getDocument = Nothing
' Collect the active document
Set docObj = appObj.ActiveDocument
If (Err) Then
MsgBox "No active document: " + Err.Description,epcbStatusFieldError
' Everything is OK, return document
Set getDocument = docObj
Again my goal is to get the PATH of the actual project.
Additional question, and sorry if it seems a very rookie one. Is there a good reference of these Objects (like MGCPCB.ExpeditionPCBApplication), that I can use during this development?
your answers are greatly appreciated.