In vb.net, I do something like this:
Dim app as ViewDraw.Application
Dim design_name As String
Dim sheet as ViewDraw.SchematicSheetDocument
app = GetObject(,"ViewDraw.Application")
design_name = app.GetProjectData.GetiCDBDesignRootBlock(app.GetActiveDesign())
sheet = app.SchematicSheetDocuments.open(design_name, 1) 'opens sheet 1
I verified that this does work. Starting with no DxDesigner open at all, it starts the tool, loads the project, then opens the sheet. Now if I was actually using it this way, I'd put some error checking in place to make sure the app was open and so on before diving into opening the sheet or doing anything else. But that's the gist of it.
If you want to get a list of the sheets, you can do this:
Dim sheet_names as New Arraylist
Dim blocks as Object
Dim block as ViewDraw.Block
blocks = app.QueryPages(design_name)
For Each block In blocks
In vbscript, the process.Start would be replaced with something like this:
set wsh = CreateObject("shell.application")
path = "D:\\projects\my_project\project.prj"
Thanks Patrick, that's it. How did you paste in your code with syntax highlighting?
The text pasting is kind of kludgey. If I paste from a text editor (notepad++), it doesn't get the colors. If I paste directly from the editor in the IDE, it does. Then I select all the text and quote it using the quote button here in the Reply text box, then change the font to Courier.
It would be really nice if they had a text formatting thing especially for pasting code that would not add but would add contextual formatting per language rules.