How can i access a parent component object from  a ComPin object ?

Discussion created by Alpha on Jun 28, 2010
Latest reply on Jun 28, 2010 by Alpha

Hello dear Member,

actually i am writing a script that should show the reference designator of all components connected
with a net that i have selected before...



Here is what i have been doing so far :


   Dim  vdapp,obj,Desgin_Name,Dxd_Ver,Dxd_Version
   Set vdapp = GetObject(, "ViewDraw.Application")  
   Index = 1
   For Each Net In vdapp.Query(VDM_NET, VD_SELECTED)
     X=ActiveView.GetSelectedNetName(FALSE, FALSE, Index)
     MsgBox X
     Index = Index + 1 
     For Each objConn In Net.Connections 
       Set objPin = objConn.CompPin.Pin
       Pin_Name = objPin.GetName(SHORT_NAME) 
       For Each Attr In objConn.CompPin.Parent.Attributes
            vdapp.AppendOutput "Attributes Names", Attr_Name
            If Attr.Name="Ref Designator" Then
             MsgBox Refdes
             End If
       vdapp.AppendOutput "Net Connections", objConn.CompPin.Parent.UID &"."&objPin.GetName(SHORT_NAME)

My Problem doing this  is that, objConn.CompPin.Parent is returning a Symbol Object ( the Parent symbols of the of the CompPin).
So i can only access the Symbol value of the reference designator, which is irrelevant ( empty) for what i want to achieve.


I want to access the Block Value ( schematic) of the reference Designator,
This would be easy if objConn.CompPin.Parent, would return a component Object.


So how can i access a parent component object from  a ComPin object ?


Or can somebody suggest me an alternative way to do this ?


Thank you...