DxDesigner - Automation Method for reordering sheets

Document created by timo_kyyronen on Jan 14, 2014
Version 1Show Document
  • View in full screen mode

 

This functionality is available in:

EE7.9.4_Update22 or newer

EE7.9.5_Update11 or newer

 

Example 1

 

 

Set App = GetObject(,"ViewDraw.Application")

Dim SchemDoc, Sheets, Sheet, DocumentSheet

ForEach SchemDocIn App.SchematicSheetDocuments.GetAvailableSchematics
    Set Sheets = App.SchematicSheetDocuments.GetAvailableSheets(SchemDoc)
    ForEach SheetIn Sheets
        Set DocumentSheet = SchematicSheetDocuments.Open( SchemDoc, Sheet )
                
        If Sheet = "3"Then
            Set OrderList = CreateObject("Viewdraw.StringList")
            OrderList.Append("4")
            OrderList.Append("2")
            OrderList.Append("1")
            'SetFollowingSheetRange is for resetting sheets after the specified sheet which is opened first
            DocumentSheet.SetFollowingSheetRange(OrderList)
        EndIf    
    Next
    
    Dim tkySheetOrders, tkySheetOrder
    'GetSheetOrder gives the sheet order
    Set tkySheetOrders = App.SchematicSheetDocuments.GetSheetOrder(SchemDoc) 
    
    ForEach tkySheetOrderIn tkySheetOrders
         MsgBox"Sheet " & tkySheetOrder
    Next    
Next

 

renumber.jpg

 

Example 2

 

 

Set App = GetObject(,"ViewDraw.Application")
Scripting.AddTypeLibrary("ViewDraw.Application")

Set OrderList = CreateObject("Viewdraw.StringList")
            OrderList.Append("4")
            OrderList.Append("3")
            OrderList.Append("1")
            OrderList.Append("2")

'SetSheetOrder reorders sheets under specified schematic
App.SchematicSheetDocuments.SetSheetOrder"AMP", OrderList

 

 

reorder2.jpg

Attachments

    Outcomes