3 Replies Latest reply on Jul 13, 2011 9:48 PM by Wolfgang_Antrey

    Script to change sheet revision in a heirarchical schematic?

    max.hartwig

      Hello.

       

      We're running DxDesigner version 2005.1.1 and we frequently run into problems with changing the revisions in heirarchical schematics, in particular

      when OATS are set to a different revision number. I've been going through all documentation on automation and scripting, which is cryptic at best,

      to determine how to create a script.

       

      Does someone have a script that will step through each sheet and apply a single revision to all sheets?

       

      Thanks

        • 1. Re: Script to change sheet revision in a heirarchical schematic?
          Wolfgang_Antrey

          I have a script - maybe you can need it.

          First we make a cross reference in Dx that sets our border symbol properties ....

          Our designs are 90% hirarchical - each hirarchical symbol has a special property => INSTANCE (Userdefined property)

          symbol.JPG

          The Border Symbols has a property HIRARCHIE_PAGE (which is the "name" of the sheet in the header).

          page.jpg

          The Instance name will overwrite the HIRARCHIE_Page property ....

           

          So you could also have a "Revision Tag on each Hirarchical Symbol" which could be written into the border symbol ....

           

          Wolfgang

           

          >

          Dim vdapp : Set vdapp = GetObject(, "ViewDraw.Application")

          Dim ZeichnungsNummer

          Dim IncludePath

          Dim sTopBlock

          sTopBlock = vdapp.GetProjectData.GetiCDBDesignRootBlock(vdapp.GetActiveDesign())

           

           

          Sub Post_xRef

            Include "L:\LIB_MMX\_SCRIPTS_7.9_\_frq_function_lib_.vbs"

            WalkDesign( sTopBlock )

          End Sub

           

          '-----------------------------------------------------------

          '---------------- Walk through the Design ------------------

          '-----------------------------------------------------------

          Function WalkDesign(sTopBlock)

            Dim dictPaths, objComp, sPath, sSchematic, sSheet

            Dim InstanceName

            Dim Attr

           

            SchematicSheetDocuments.Close

           

            Set dictPaths = CreateObject("Scripting.Dictionary")

           

            dictPaths.Add "", sTopBlock

           

            For Each objComp In Application.DesignComponents("", sTopBlock, "-1", "STD", True)

              If objComp.SymbolBlock.SymbolType = VDB_COMPOSITE Then

                 sPath = objComp.GetName(0)

                 On Error Resume Next

                 sSchematic = objComp.SymbolBlock.GetName(0)

                 If Err.Number > 0 Then

                     sSchematic = objComp.SymbolBlock.GetName(2)

                 End If

                 InstanceName = search_attribute(objComp, "INSTANCE")

                 dictPaths.Add sPath, sSchematic

              End If

            Next

           

            For Each sPath In dictPaths.Keys

              sSchematic = dictPaths(sPath)

              For Each sSheet In Application.SchematicSheetDocuments.GetAvailableSheets(sSchematic)

                Application.PushPath sTopBlock, sPath, sSheet

                ' jetzt das seiten attribute HIRARCHIE_PAGE finden und durch "sPath & "." & sSheet" ersetzen ...

           

                For Each objComp In ActiveView.Query(VDM_COMP, VD_ALL)

                  if objComp.SymbolBlock.Getname(SHORT_NAME) = "frq_a3" then

                     set Attr = objComp.FindAttribute("HIRARCHIE_PAGE")

                     if Attr is nothing then

                     Else

                       ' wir haben ein Seiten Attribute gefunden ....

                       If sPath = "" Then

                          Attr.InstanceValue = sTopBlock & "." & sSheet

                       Else

                          Attr.InstanceValue = sPath & "." & sSheet

                       End If

                     end if

                  end if

                Next

                SchematicSheetDocuments.Close

              Next

            Next

           

            Scripting.sleep 100

            Application.SchematicSheetDocuments.Open sTopBlock, "1"

           

          End Function

          1 of 1 people found this helpful
          • 2. Re: Script to change sheet revision in a heirarchical schematic?
            max.hartwig

            Thanks Wolfgang! This is a good idea for the future, if we have to use heirarchical schematics. We won't want to touch the legacy schematics, however,

            to modify them in this manner. Some code snippets contained in your script gives me an idea that I may try on our current schematics.

             

            Thanks again, and best regards!

            Max

            • 3. Re: Script to change sheet revision in a heirarchical schematic?
              Wolfgang_Antrey

              Sorry - I read you used 2005.1. My script works on EE 7.9.x.

               

              But for 2005 you could use "SCOUT.EXE".

              This tool needs some configuration but I attached our company INI for 2005.3.

              I hope this works.

               

              We have an empty border symbol => frq_a3.1 which is added to each page.

               

              In the Scout.ini the used text fields are pointed to the position on the page.

               

              So it is very easy to generate a schematic with only 1 file that keeps all your information about designer, drawing number version.

              Just run scout and all schematic headers will look like the same.

               

              For 2005.3 I have written a script - which corrects the hirarchical page headers.

               

              best regards

               

              Wolfgang