1 2 Next Last 29 Replies Latest reply on Sep 5, 2018 6:36 AM by peter_festesen Go to original post
      • 16. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
        peter_festesen

        Ok, I have done some digging already

        Property Values can exist on three levels - Symbol, Block and Instance

         

        objComp.SymbolBlock.Attributes will list all properties that are defined at Symbol OR Block Level (but NOT Instance Level)

         

        objComp.Attributes will list all properties that are defined at Block OR Instance Level. Properties that have ONLY Symbol Level defined, are ignored.

         

        This implies that a property that exists on the symbol in the library, but is left unused, will not be listed with objComp.Attributes.

         

        One Important exception that I found is the famous @PrintOrder, which does NOT show up in objComp.SymbolBlock.Attributes, but only for objComp.Attributes. This may be the case for my test design only, I'd like to hear other peoples findings.

         

        I found this by running the attached script. Save as .vbs and run inside DxDesigner with run <path to script>

         

        I am interested in seeing your results....

        • 17. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
          Patrick.Cashman

          I ran your script. Here is the output from my sheet 1:

           

          Found 15 cmp.SymbolBlock.Attributes
          Block _DrawnBy_; ; Instance_DrawnBy_; ; Either _DrawnBy_;
          Block _DrawnDate_; ; Instance_DrawnDate_; ; Either _DrawnDate_;
          Block _CheckedBy_; ; Instance_CheckedBy_; ; Either _CheckedBy_;
          Block _CheckedDate_; ; Instance_CheckedDate_; ; Either _CheckedDate_;
          Block _ApprovedBy_; ; Instance_ApprovedBy_; ; Either _ApprovedBy_;
          Block _ApprovedDate_; ; Instance_ApprovedDate_; ; Either _ApprovedDate_;
          Block _Title_; ; Instance_Title_; ; Either _Title_;
          Block _Revision_; ; Instance_Revision_; ; Either _Revision_;
          Block _Revision-2_; ; Instance_Revision-2_; ; Either _Revision-2_;
          Block _@DATETIME_; ; Instance_@DATETIME_; ; Either _@DATETIME_;
          Block _@SHEET_; ; Instance_@SHEET_; ; Either _@SHEET_;
          Block _@SHEETTOTAL_; ; Instance_@SHEETTOTAL_; ; Either _@SHEETTOTAL_;
          Block _MATNO_; ; Instance_MATNO_; ; Either _MATNO_;
          Block _SMTNO_; ; Instance_SMTNO_; ; Either _SMTNO_;
          Block _DrawingNumber_; ; Instance_DrawingNumber_; ; Either _DrawingNumber_;
          *************************

          *************************
          Found 17 cmp.Attributes
          Block _Title_; RECEIVE IF; Instance_Title_; ; Either _Title_; RECEIVE IF
          Block _@PRINTORDER_; ; Instance_@PRINTORDER_; 1; Either _@PRINTORDER_; 1
          Block _DrawnBy_; RENE DESCARTES; Instance_DrawnBy_; ; Either _DrawnBy_; RENE DESCARTES
          Block _DrawingNumber_; 10000044683; Instance_DrawingNumber_; ; Either _DrawingNumber_; 10000044683
          Block _SMTNO_; 141192; Instance_SMTNO_; ; Either _SMTNO_; 141192
          Block _MATNO_; 141191; Instance_MATNO_; ; Either _MATNO_; 141191
          Block _@SHEETTOTAL_; 21; Instance_@SHEETTOTAL_; 21; Either _@SHEETTOTAL_; 21
          Block _@SHEET_; 1; Instance_@SHEET_; ; Either _@SHEET_; 1
          Block _@DATETIME_; 20-12-2017_10:53; Instance_@DATETIME_; 20-12-2017_10:53; Either _@DATETIME_; 20-12-2017_10:53
          Block _Revision-2_; AA; Instance_Revision-2_; ; Either _Revision-2_; AA
          Block _Revision_; AA; Instance_Revision_; ; Either _Revision_; AA
          Block _ApprovedDate_; 20DEC17; Instance_ApprovedDate_; ; Either _ApprovedDate_; 20DEC17
          Block _ApprovedBy_; JOHN SMITH; Instance_ApprovedBy_; ; Either _ApprovedBy_; JOHN SMITH
          Block _CheckedDate_; 20DEC17; Instance_CheckedDate_; ; Either _CheckedDate_; 20DEC17
          Block _CheckedBy_; DAVEY JONES; Instance_CheckedBy_; ; Either _CheckedBy_; DAVEY JONES
          Block _DrawnDate_; 20DEC17; Instance_DrawnDate_; ; Either _DrawnDate_; 20DEC17
          Block _FORWARD_PCB_; 0; Instance_FORWARD_PCB_; ; Either _FORWARD_PCB_; 0
          Found 0 cmp.SymbolBlock.Attributes
          *************************

           

          This is similar to the output I got from my test script in your other thread.

          • 18. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
            fuba

            Hello, this here below is the answer from your script on my 2 page dummy job.

             

            Found 24 cmp.SymbolBlock.Attributes
            Block _fmt_apr_1_; ; Instance_fmt_apr_1_; ; Either _fmt_apr_1_;
            Block _fmt_apr_2_; ; Instance_fmt_apr_2_; ; Either _fmt_apr_2_;
            Block _fmt_apr3_date_; ; Instance_fmt_apr3_date_; ; Either _fmt_apr3_date_;
            Block _fmt_apr_3_; ; Instance_fmt_apr_3_; ; Either _fmt_apr_3_;
            Block _fmt_apr1_date_; ; Instance_fmt_apr1_date_; ; Either _fmt_apr1_date_;
            Block _fmt_apr2_date_; ; Instance_fmt_apr2_date_; ; Either _fmt_apr2_date_;
            Block _@Sheet_; ; Instance_@Sheet_; ; Either _@Sheet_;
            Block _@SheetTotal_; ; Instance_@SheetTotal_; ; Either _@SheetTotal_;
            Block _fmt_Ref_; ; Instance_fmt_Ref_; ; Either _fmt_Ref_;
            Block _fmt_First_Used_; ; Instance_fmt_First_Used_; ; Either _fmt_First_Used_;
            Block _@Name_; ; Instance_@Name_; ; Either _@Name_;
            Block _fmt_copyright_year_; 2017; Instance_fmt_copyright_year_; ; Either _fmt_copyright_year_; 2017
            Block _fmt_copyright_rev_; REVISED 2017; Instance_fmt_copyright_rev_; ; Either _fmt_copyright_rev_; REVISED 2017
            Block _fmt_cad_version_; EEVX.1; Instance_fmt_cad_version_; ; Either _fmt_cad_version_; EEVX.1
            Block _fmt_current_rev_; ; Instance_fmt_current_rev_; ; Either _fmt_current_rev_;
            Block _fmt_date_designer_; ; Instance_fmt_date_designer_; ; Either _fmt_date_designer_;
            Block _fmt_ddesym_; D CONFIDENTIAL; Instance_fmt_ddesym_; ; Either _fmt_ddesym_; D CONFIDENTIAL
            Block _fmt_designer_; ; Instance_fmt_designer_; ; Either _fmt_designer_;
            Block _fmt_schem_name_; ; Instance_fmt_schem_name_; ; Either _fmt_schem_name_;
            Block _fmt_d_A1_; A1; Instance_fmt_d_A1_; ; Either _fmt_d_A1_; A1
            Block _fmt_owner_; ; Instance_fmt_owner_; ; Either _fmt_owner_;
            Block _fmt_owner_date_; ; Instance_fmt_owner_date_; ; Either _fmt_owner_date_;
            Block _fmt_user_; ; Instance_fmt_user_; ; Either _fmt_user_;
            Block _fmt_user_date_; ; Instance_fmt_user_date_; ; Either _fmt_user_date_;
            *************************

            *************************
            Found 29 cmp.Attributes
            Block _fmt_user_; Donald Duck; Instance_fmt_user_; ; Either _fmt_user_; Donald Duck
            Block _fmt_user_date_; ; Instance_fmt_user_date_; ; Either _fmt_user_date_;
            Block _fmt_apr_1_; ; Instance_fmt_apr_1_; ; Either _fmt_apr_1_;
            Block _fmt_apr_2_; ; Instance_fmt_apr_2_; ; Either _fmt_apr_2_;
            Block _fmt_apr3_date_; ; Instance_fmt_apr3_date_; ; Either _fmt_apr3_date_;
            Block _fmt_apr_3_; ; Instance_fmt_apr_3_; ; Either _fmt_apr_3_;
            Block _fmt_apr1_date_; ; Instance_fmt_apr1_date_; ; Either _fmt_apr1_date_;
            Block _fmt_apr2_date_; ; Instance_fmt_apr2_date_; ; Either _fmt_apr2_date_;
            Block _@Sheet_; 1; Instance_@Sheet_; ; Either _@Sheet_; 1
            Block _@SheetTotal_; 1; Instance_@SheetTotal_; ; Either _@SheetTotal_; 1
            Block _fmt_Ref_; ; Instance_fmt_Ref_; ; Either _fmt_Ref_;
            Block _fmt_First_Used_; ; Instance_fmt_First_Used_; ; Either _fmt_First_Used_;
            Block _@Name_; Schematic1; Instance_@Name_; ; Either _@Name_; Schematic1
            Block _fmt_sheet_backup_; Homer J Simpson; Instance_fmt_sheet_backup_; ; Either _fmt_sheet_backup_; Homer J Simpson
            Block _fmt_sheet_backup_; HelloWorld; Instance_fmt_sheet_backup_; ; Either _fmt_sheet_backup_; HelloWorld
            Block _fmt_sheet_backup_; blabla; Instance_fmt_sheet_backup_; ; Either _fmt_sheet_backup_; blabla
            Block _fmt_schem_number_; 123456789; Instance_fmt_schem_number_; ; Either _fmt_schem_number_; 123456789
            Block _fmt_cad_version_; EEVX.2.1; Instance_fmt_cad_version_; ; Either _fmt_cad_version_; EEVX.2.1
            Block _fmt_current_rev_; A; Instance_fmt_current_rev_; ; Either _fmt_current_rev_; A
            Block _fmt_date_designer_; ; Instance_fmt_date_designer_; ; Either _fmt_date_designer_;
            Block _fmt_ddesym_; D CONFIDENTIAL; Instance_fmt_ddesym_; ; Either _fmt_ddesym_; D CONFIDENTIAL
            Block _fmt_designer_; ; Instance_fmt_designer_; ; Either _fmt_designer_;
            Block _fmt_schem_name_; ; Instance_fmt_schem_name_; ; Either _fmt_schem_name_;
            Block _fmt_d_A1_; A1; Instance_fmt_d_A1_; ; Either _fmt_d_A1_; A1
            Block _fmt_owner_; Homer Simpson; Instance_fmt_owner_; ; Either _fmt_owner_; Homer Simpson
            Block _fmt_owner_date_; ; Instance_fmt_owner_date_; ; Either _fmt_owner_date_;
            Block _fmt_copyright_year_; 2017; Instance_fmt_copyright_year_; ; Either _fmt_copyright_year_; 2017
            Block _fmt_copyright_rev_; ; Instance_fmt_copyright_rev_; ; Either _fmt_copyright_rev_;
            Block _FORWARD_PCB_; 0; Instance_FORWARD_PCB_; ; Either _FORWARD_PCB_; 0

             

            ===> so a difference of 5 Attributes (marked in green). 4 of them I added manually

            via the Properties Window "_FORWARD_PCB_" was initially available.

             

            So my conclusion is, when something is added by the user/designer information has to be pulled via

            Comp.Attributes. If I am looking for default / initial values of the Sysmbol I have to go via

            Comp.SymbolBlock.Attributes

             

            Thanks

             

            • 19. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
              mxw

              Hi Peter,

               

              I am a new associate AE who is on board this year. I am learning DxDesigner automation recently.

              Here I have a question about this topic. Could you help me and answer my question?

               

              According to your discussion, we can read symbol level value by objComp.SymbolBlock.Attributes. However, If I want to read the symbol value of a CompPin's pin type, objCompPin.SymbolBlock.findattribute(""Pin Type") is not available. Is there any method to read the symbol value of pin type when there is no block value?

               

              Best regards,

              Xiaowen Min

               

              Here enclose part of my script:

              For Each Conn In Comp.GetConnections()

              Set CompPin = Conn.CompPin

              If Not CompPin Is Nothing Then

              Set Pin = CompPin.Pin

              Set Net = Conn.Net

              PinUID = Pin.UID

              PinNumber = CompPin.Number

              Dim Attr

              Set Attr = CompPin.FindAttribute("Pin Type")

              If Attr Is Nothing Then

              PinType = "No PINTYPE"

              Else

              PinType = Attr.Value

              End If

              ...

              ...

               

              • 20. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                fuba

                Hello mxw

                 

                to Readout PinType, and Sense, you do:

                 

                First get a Componet, than its PinObject

                 

                  '# Get the connections(pins) on the symbol
                  Dim pinObj As ViewDraw.IVdObjs
                  Set pinObj = comp.GetConnections()

                 

                  For x = 1 To pinObj.Count()

                      Dim theConnection As ViewDraw.Connection
                      Set theConnection = pinObj.Item(x)

                 

                      Dim pinType As ViewDraw.VdObjectType
                      pinType = theConnection.CompPin.Type

                 

                      Dim theSense As String
                      theSense = getPinSense(theConnection)
                                         
                      Dim pinDirection As String
                      pinDirection = getPinDirection(theConnection)

                 

                next x

                 

                 

                 

                Function getPinSense(theConnection As ViewDraw.Connection) As String

                         '#
                         '# inverted or not
                         Dim Sense As ViewDraw.VdSense
                         Sense = theConnection.CompPin.pin.Sense
                                                 
                         Dim theSense As String
                         Select Case Sense
                                Case ViewDraw.VdSense.VDINVERTED
                                     theSense = "Inverted"
                                Case ViewDraw.VdSense.VDNOTINVERTED
                                     theSense = "NotInverted"
                                Case Else
                                     theSense = "?"
                         End Select
                        
                         '# alternative idea for
                         '# inverted/notInverted Pin/Signal
                         If 1 Then
                           
                            Dim PinName As String
                                PinName = theConnection.CompPin.pin.GetName(ViewDraw.VdNameType.SHORT_NAME)  'pin Name
                        
                            If Left(PinName, 1) = "~" Then
                               theSense = "Inverted"
                            Else
                               theSense = "NotInverted"
                            End If
                         End If

                         getPinSense = theSense

                End Function

                 

                Function getPinDirection(theConnection As ViewDraw.Connection) As String

                         Dim pinDirection As String
                             pinDirection = ""
                       
                         '# We try to get Pin Direction
                         '# (Pin = in, out, bi, ...)
                         Dim numOfAttributes As Integer
                             numOfAttributes = theConnection.CompPin.pin.Attributes.Count
                        
                         Dim j As Integer
                        
                         Dim attribPinTypeFound As Boolean
                             attribPinTypeFound = False
                            
                         For j = 1 To numOfAttributes
                           
                            Dim pinAttrib As ViewDraw.Attribute
                            Set pinAttrib = theConnection.CompPin.pin.Attributes.Item(j)
                           
                            'Debug.Print "attributeName: " & pinAttrib.name & " --> Value: " & pinAttrib.Value
                            
                            Dim attribName As String
                            Dim attribValue As String
                            Dim attribTextString As String
                            
                            attribName = pinAttrib.name
                            attribValue = pinAttrib.Value
                            attribTextString = pinAttrib.TextString
                           
                            pinDirection = ""
                                      
                           
                            If attribName = "Pin Type" Then
                              
                               If attribValue <> "" Then
                                  pinDirection = attribValue
                                  attribPinTypeFound = True
                                  Exit For
                               ElseIf attribValue = "" Then
                                      pinDirection = "?"
                               ElseIf attribTextString = "" Then
                              
                               Else
                                   pinDirection = "??"
                               End If
                              
                            ElseIf attribName = "BlahBlah" Then
                           
                            ElseIf attribName = "VHDL_PORT" Then
                           
                            ElseIf attribName = "VHDL Type" Then
                           
                            Else
                           
                            End If
                            
                         Next j
                        
                         If attribPinTypeFound = False Then
                            pinDirection = "Property Not Found"
                         End If
                        
                         '# Return our Result
                         getPinDirection = pinDirection
                  
                End Function

                 

                Check the "getPinDirection" Function, it loops manually through each Attribute

                In my case it works perfect.

                 

                Hope this can guide you a little bit further.

                regards Stefan

                • 21. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                  mxw

                  Hi Stefan,

                   

                  Thanks for you replay. According to your script, I find I need to use objCompPin.Pin.findattribute(""Pin Type") to get the symbol level value, instead of objCompPin.findattribute(""Pin Type").

                  The pin object represents a symbol pin on a schematic. After this modification, my scripts works.

                  Thanks for your reference, it is very helpful.

                   

                  Best regards,

                  Xiaowen

                  • 22. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                    peter_festesen

                    Hello - thanks for reaching out to the community !

                     

                    Could you please do us a favor and move this discussion into it's own thread.

                     

                    I will have to do some digging and will answer in the separate thread. 

                     

                    /Peter

                    • 23. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                      peter_festesen

                      I just saw fuba's reply - great stuff!!! I still think we should move this discussion into it's own thread.

                      /Peter  

                      • 24. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                        mxw

                        HI Peter,

                         

                        Sorry, Could you tell me how to move the discussion into separate thread? I am new to the communities.

                        And do you means I should open a new thread to ask question instead of replay on the older one?

                        If yes, next time I will do it.

                         

                        Best regard,

                        Xiaowen

                        • 25. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                          peter_festesen

                          Xiaowen - to be honest I don't know if it is possible to move it, since now we do have other replies. Let us just keep it here for now ;-)

                           

                          /Peter

                          • 26. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                            cathy_terwedow

                            Although the communities don't support splitting a thread into multiples, I can copy-paste this new topic into a separate post. How would you like it to be titled?

                            • 27. Re: xDxDesigner - readout Attribute which is multiple times on the same Sheet via Automation
                              peter_festesen

                              Hi Cathy - that would be splendid (easier for others to find as well) - I suggest we call it

                               

                              'How to find a CompPin's pin type'

                              1 2 Next Last