Quantcast
Channel: Mentor Graphics Communities: Message List
Viewing all articles
Browse latest Browse all 1329

Re: Access RefDes Properties (Text Height, Font Type, ...) in xPCB

$
0
0

That refdes is a new object with VX.  I'm not sure exactly what it is. My guess is either FabricationLayerText or ConductorLayerText.

 

In the first case, here's an example of some of the things you might do to interact with it:

 

           comps = doc.Components(0)

         ForEach comp In comps

                

             'Loop through all the Fab text on the component

             fabtxt_objs = comp.FabricationLayerTexts

             fabtxt_obj = Nothing

             ForEach fabtxt_obj In fabtxt_objs

                 If fabtxt_obj.Type = 1 Then'Select out Assy Text

                     Ifnot fabtxt_obj.TextString = comp.RefDes Then'stuff other than refdes

                         fabtxt_obj.Format.Font = assyfont

                         goto next_fabtxt_obj

                     Else    'refdes

                        

                         fabtxt_obj.Format.Orientation = 0

                        

                         fabtxt_obj.Format.HorizontalJust = 0

                         fabtxt_obj.Format.VerticalJust = 0

                        

                         if comp.Side = 1 then

                             fabtxt_obj.Format.Mirrored = false

                         Else

                             fabtxt_obj.Format.Mirrored = True

                         EndIf

                        

                         fabtxt_obj.Format.Font = assyfont

                         fabtxt_obj.Format.Bold = False

    

                        

                     EndIf

                 ENdIf

                 next_fabtxt_obj:

             Next

Next

In the case of ConductorLayerText, you would probably treat it similarly, as in

clayertxts = comp.ConductorLayerTexts

         ForEach clayertxt In clayertxts

            

             If clayertxt.TextType = 1 Then        'Type 1 is epcbTextRefDes

                 clayertxt.Format.Height = 50

                 'etc, same as above

             EndIf

Next

 

Information about the fabrication and conductor layer text objects is in the help.  The .Type and .TextType properties are listed there, with information on what kind of object each type is. 


Viewing all articles
Browse latest Browse all 1329

Trending Articles



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