2 Replies Latest reply on Apr 7, 2010 10:59 AM by french1

    DxDesigner Automation vb.net Pt. 2

      I'm having problems wrapping my head around the COM for Dx, I have a good amount of exposure to the expedition COM and maybe thats why Im getting stuck thinking that they should work similarly.


      I want to get a specific symbol out of my schematic and then parse through each pin and collect the associated data.  I feel like this should be do able but nothing in appDx, vddoc, or vdview appear to give me what I need.  What am I missing?


          Dim WithEvents appDX As ViewDraw.Application
          Dim vddocColl As ViewDraw.Documents
          Dim vddoc As ViewDraw.Document
          Dim vdview As ViewDraw.View


      Private Sub getfpga()


              vddoc = appDX.ActiveDocument
              vdview = appDX.ActiveView


              Dim comp As ViewDraw.Component

              comp = ???


              Dim pin as ViewDraw.ComponentPin

              pin = ???


          End Sub

        • 1. Re: DxDesigner Automation vb.net Pt. 2

          Use the Query method on the view object (Application.ActiveView), to get the collection of components (selected or all).


          From the component object, use the Connections property to get a collection of connection objects, which is linkage between component pin and net segments.



          • 2. Re: DxDesigner Automation vb.net Pt. 2

            Just something quick and dirty but could be a decent example for anyone else that migh be having difficulty.  If I miss understood you John and theres an easier way let me know please.


            Private Sub getCompInfo()


                    vdview = appDX.ActiveView


                    Dim pinNum As String
                    Dim pinName As String
                    Dim netName As String


                    Dim compObj As ViewDraw.IVdObjs
                    Dim comp As ViewDraw.Component


                    Dim pinObj As ViewDraw.IVdObjs
                    Dim pin As ViewDraw.Connection


                    'Get the selected Symbol

                    compObj = vdview.Query(ViewDraw.VdObjectTypeMask.VDM_COMP, ViewDraw.VdAllOrSelected.VD_SELECTED)
                    comp = compObj.Item(1)


                    'Get the connections(pins) on the symbol

                    pinObj = comp.GetConnections()


                    'Step through each connection and get the pin number, pin name, and the net name connected to the pin

                    For x = 1 To pinObj.Count
                        pin = pinObj.Item(x)



                            pinNum = pin.CompPin.Number    'Pin Number
                            pinName = pin.CompPin.Pin.GetName(ViewDraw.VdNameType.SHORT_NAME)   'pin Name
                            netName = pin.Net.GetConnectedNetName(pin.Segment)   'Net name connected to pin


                            MsgBox(pinNum & " | " & pinName & " | " & netName)






                        End Try




                End Sub