That is the only way. Keep in mind that you do not need to open each sheet hierarchically, since the sheet size and border symbol would be the same on any instance.
As I understood from your answer, it's enough to go through the Blocks.
I tried to find a function that returns a collection of blocks without opening a sheet and I couldn't find one (something like DesignComponents).
I tested the function OpenBlocks, and I noticed that it's requires for a block to be opened. and when using it, it returns only the schematics blocks of the selected block.
Also I tested QueryPages, but it's also doesn't seems to helps.
Can you please advise on the right way of accomplish this task, with minimum runtime.
John, Thank you very much
I almost finished the task, but I encounter some problem.
When I'm running the code that changes the sheet size using the function SheetSize, I can see in the dxdesigner that the sheet is changed, but the property Drawing size doesn't.
After closing and reopening the block, the setting are not saved.
I tried to look for an attribute drawing size, but couldn't find any.
How come the SheetSize function doesn't being saved?
You can see the function that traverse all the blocks and changes the sheet size:
sSchematic, sSheet, sSchematics, sSheets
sSchematics = dxApp.SchematicSheetDocuments.GetAvailableSchematics
sSheets = dxApp.SchematicSheetDocuments.GetAvailableSheets(sSchematic)
sBlocks = dxApp.ActiveView.Query(ViewDraw.VdObjectTypeMask.VDM_BLOCK, ViewDraw.VdAllOrSelected.VD_ALL)
sBlock.SheetSize = ViewDraw.VdSheetSize.VDSHEET_DSIZE
It seems to be a bug with the SheetSize property, I found DR654828 ("Application.ActiveView.ActiveBlock.SheetSize=VDSHEET_A3_SIZE does not update the "Drawing Size" value in the GUI"). I recommend filing a service request on SupportNet to link to this defect report.
As a workaround, you can call the SetZSheetSize method with the dimensions for a D-size sheet:
dxApp.ActiveView.Block.SetZSheetSize 3400, 2200