5 Replies Latest reply on Mar 23, 2010 7:23 AM by john_dube

    Sheetsize and delete border without opening schematic?!

    navit.alaouf

      Hello,

       

      We need a utility that check each sheet of the design for sheetsize and in case it's necessary we need to delete the existing border.

      After examining the dxdesigner API, we found that the only way to accomplish this task is by opening each sheet.

      This operation takes log time especially in big designs.

       

      Is there any other way to accomplish this task?

       

      Thanks

      Navit

        • 1. Re: Sheetsize and delete border without opening schematic?!
          john_dube

          Hi Navit,

           

          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.

           

          John

          • 2. Re: Sheetsize and delete border without opening schematic?!
            navit.alaouf

            Thanks John,

             

            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.

             

            Thanks,

            Navit

            • 3. Re: Sheetsize and delete border without opening schematic?!
              john_dube

              Hi Navit,

               

              See the second code block in the "How to visit each schematic sheet in DxDesigner 2007.x" document:

               

              http://communities.mentor.com/docs/DOC-1345

               

              John

              • 4. Re: Sheetsize and delete border without opening schematic?!
                navit.alaouf

                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:

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                 

                Dim

                sSchematic, sSheet, sSchematics, sSheets

                 

                 

                Dim sBlock, sBlocks

                dxApp.SchematicSheetDocuments.Close()

                sSchematics = dxApp.SchematicSheetDocuments.GetAvailableSchematics

                 

                 

                For Each sSchematic In sSchematics

                sSheets = dxApp.SchematicSheetDocuments.GetAvailableSheets(sSchematic)

                 

                 

                For Each sSheet In sSheets

                dxApp.SchematicSheetDocuments.Open(sSchematic, sSheet)

                sBlocks = dxApp.ActiveView.Query(ViewDraw.VdObjectTypeMask.VDM_BLOCK, ViewDraw.VdAllOrSelected.VD_ALL)

                 

                 

                For Each sBlock In sBlocks

                sBlock.DeleteBorder()

                 

                 

                If sBlock.SheetSize <> ViewDraw.VdSheetSize.VDSHEET_DSIZE Then

                sBlock.SheetSize = ViewDraw.VdSheetSize.VDSHEET_DSIZE

                 

                 

                End If

                 

                 

                Next

                dxApp.SchematicSheetDocuments.Close()

                 

                 

                Next

                dxApp.SchematicSheetDocuments.Close()

                 

                 

                Next

                 

                Thanks Navit

                • 5. Re: Sheetsize and delete border without opening schematic?!
                  john_dube

                  Hi Navit,

                   

                  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

                   

                  John