Quantcast
Viewing all articles
Browse latest Browse all 4541

Re: Component

The component, as you are using it (scomp & comp) consists only of a single symbol.  There is not an object like what you describe, an scomp which includes several symbols.

 

But let us digress for a moment, to the fast way to do exactly what you want.  If you are working in an integrated design environment with DxDesigner and Xpedition, and you are constrained to use only DxDesigner for this task, just do it in Xpedition.  There you can select an entire component, and quickly get a collection of all the nets attached to the component. 

 

As in:

dim comp as mgcpcb.component

dim nets as mgcpcb.nets

 

comp = pcbdoc.findcomponent(refdes)

nets = comp.nets

 

But, if you must use DxDesigner for this task, it is a bit more complicated.

 

What you have to do is make a collection variable of nets. Then loop through all the components and select them out by refdes as you have already done.  For each component, you'll do something like the following:

 

Dim nets as List(of viewdraw.net)

Dim net as viewdraw.net

Dim comps as Object

Dim comp as viewdraw.component

Dim conns as Object

Dim conn as viewdraw.connection

 

(get comps with the query like you already did)

 

nets.clear

for each comp in comps

     if comp.refdes = myrefdes then

          conns = comp.getconnections

           for each conn in conns

                   nets.add(conn.net)

           Next

     End If

Next

 

Now you have a list of nets.  You can use the ViewDraw nets collection, as you can get using the view.query(32,1), but working with those collections is a bit more clumsy than the generic vb collections, so it's just easier to use the List.  If using a .net environment, you could also use an arraylist, which is even easier because it will hold most any datatype without complaining.

 

With the list of nets, you can loop through and do whatever you need to with each net.

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 4541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>