In xDX Designer Automation Reference, Project Data Object section (page 409). It states that the ProjectData methods which modify project data ("modifier-methods") actually modify only the project file itself, so xDX Designer wouldn't be aware of these changes until it would read this project file. Situations where project file contents are unsynchronized with the application's internal state could cause unexpected behavior.
I have a simple script which checks and sets the CL path in the .prj file to the correct value, when the project is opened in DxDesigner. But as I understand from the above this only changes the value in the .prj file itself and not what is already loaded for the project in DxDesigner. Is there a way to synchronize these using automation?
In my program currently, I just inform the user that the value has changed and that they should close the project and reopen the project in DxDesigner, for this change to take effect.
' Run on an open document.
Set vdapp = GetObject (,"ViewDraw.Application")
' Get top level design name
Dim ProjectData, DesignName
Set ProjectData = vdapp.GetProjectData()
If Not (ProjectData.CentralLibraryPath = "/home/dms_lib/dms_lib.lmc") Then
MsgBox("Warning: ****** Central Library path is being set to /home/dms_lib/dms_lib.lmc for this project. You must close this project and reopen for this change to take effect. File>Close Project")
ProjectData.CentralLibraryPath = "/home/dms_lib/dms_lib.lmc"
Lexmark International Inc
Use the Application.CloseProject() and Application.OpenProject methods to do what you are asking the user to do.