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

Re: Automated Screenshot of xPCB Layout Layers

$
0
0

With the current release, the Automation of Display Control is quite functional, and very different than it was in 7.9.x and before.  You can do anything you want to with it, as before, it's just different.  Problem is that the help files are both incorrect and inadequate, so there's a bit of wandering in the dark. 

 

Good news is that someone at Mentor made an Excel spreadsheet with VBA code in it that demonstrates how to do it. It's in the Mentor install tree at:

 

C:\MentorGraphics\EEVX.1.2\SDD_HOME\standard\examples\pcb\Automation\Excel\DisplayControl.xls

 

There are examples in there, in the VBA code, of how to interact with the Display Control.  Even with this, it's still kind of confusing, until you figure out which group a particular layer or items belongs to. Here is some code that shows a number of commands used to turn on and off different layers:

 

     Public dsp As MGCPCB.DisplayControl

     Public view As MGCPCB.View

     Public gui As MGCPCB.Gui

     Public globl As MGCPCB.GlobalDisplayControl

 

PublicSub setup_layers()

    

         'Do all the common items

'-----------------------------------------------------------------------------------------------------

         'Turn off Route Objects

         dsp.Option("Option.RouteObjects.Enable") = 0

        

         'Turn off Place Objects

         dsp.Option("Option.PlaceObjects") = 0

        

         'Turn Board Items

         dsp.Option("Option.Fiducials.Enabled") = 0

         dsp.Option("Option.MountingHolePads.Enabled") = 0

         dsp.Visible("Fabrication.Hole.Mounting") = 0

         dsp.Visible("Fabrication.Hole.Contour") = 0

         dsp.Visible("Board.ManufacturingOutline") = 0

        

        

         'Turn off Drill Drawing

         dsp.Option("Option.Fabrication.DrillDrawing") = 0

        

         'Turn off Fabrication Objects

         dsp.Option("Option.Fabrication.CellItems.Bottom") = 0

         dsp.Option("Option.Fabrication.CellItems.Top") = 0

         dsp.Option("Option.Fabrication.TestPointItems.Bottom") = 0

         dsp.Option("Option.Fabrication.TestPointItems.Top") = 0

         dsp.Visible("Fabrication.Assembly.TestPoint.Text.RefDes.Bottom") = 0

         dsp.Visible("Fabrication.Assembly.TestPoint.Text.RefDes.Top") = 0

         dsp.Option("Option.Fabrication.AssemblyItems.Bottom") = 0

         dsp.Option("Option.Fabrication.AssemblyItems.Top") = 0

         dsp.Visible("Fabrication.SolderPaste.Bottom") = 0

         dsp.Visible("Fabrication.SolderPaste.Top") = 0

         dsp.Visible("Fabrication.Assembly.Part.Text.PartNumber.Bottom") = 0

         dsp.Visible("Fabrication.Assembly.Part.Text.PartNumber.Top") = 0

        

        

         'Turn off some of the Top Silkscreen items

         dsp.Visible("Fabrication.Silkscreen.Part.Text.PartNumber.Top") = 0

         dsp.Visible("Fabrication.Silkscreen.Generated.Top") = 0

         dsp.Visible("Fabrication.Silkscreen.TestPoint.Probe.Top") = 0

         dsp.Visible("Fabrication.Silkscreen.TestPoint.Text.RefDes.Top") = 0

        

        

         'Turn off user layers

         'dsp.Option("Option.UserDraftLayers.Enable") = 0

        

         'Turn off coloring nets and net classes

         dsp.Option("Global.Option.ColorByNetClass.NetClasses.Enable") = 0

         dsp.Option("Global.Option.ColorByNetClass.Nets.Enable") = 0

        

        

         'Now do the specific items based on paramaters

'-----------------------------------------------------------------------------------------------------

         Debug.Print("txt_type is " & txt_type)

         Debug.Print("side is " & side)

         SelectCase txt_type

             Case 1    'assy

                 'Turn off Soldermask Objects

                 dsp.Visible("Fabrication.SolderMask.Bottom") = 0

                 dsp.Visible("Fabrication.SolderMask.Top") = 0

                

                 'Turn off Bottom Silkscreen

                 dsp.Option("Option.Fabrication.SilkscreenItems.Bottom") = 0

                

                 'Turn off Top Silkscreen

                 dsp.Option("Option.Fabrication.SilkscreenItems.Top") = 0

                

                 SelectCase side

                     Case 1    'top

                         gui.ActiveRouteLayer = 1

                        

                         dsp.Option("Option.Fabrication.AssemblyItems.Top") = 1

                         dsp.Visible("Fabrication.Assembly.Part.Text.RefDes.Top") = 1

                         dsp.Visible("Fabrication.Assembly.Part.Outline.Top") = 1

                         dsp.Option("Option.Fabrication.AssemblyItems.Bottom") = 0

                        

                     Case 2    'bottom

                         gui.ActiveRouteLayer = doc.LayerCount

                        

                         dsp.Option("Option.Fabrication.AssemblyItems.Bottom") = 1

                         dsp.Visible("Fabrication.Assembly.Part.Text.RefDes.Bottom") = 1

                         dsp.Visible("Fabrication.Assembly.Part.Outline.Bottom") = 1

                        

                         dsp.Option("Option.Fabrication.AssemblyItems.Top") = 0

                        

                 EndSelect

                

             Case 2    'silk

                

                 dsp.Option("Option.Fabrication.AssemblyItems.Top") = 0

                 dsp.Option("Option.Fabrication.AssemblyItems.Bottom") = 0

                

                 SelectCase side

                     Case 1    'top

                         gui.ActiveRouteLayer = 1

                        

                         dsp.Visible("Fabrication.SolderMask.Top") = 1

                         dsp.Visible("Fabrication.SolderMask.Bottom") = 0

                        

                         dsp.Option("Option.Fabrication.SilkscreenItems.Top") = 1

                         dsp.Option("Option.Fabrication.SilkscreenItems.Bottom") = 0

                        

                         dsp.Visible("Fabrication.Silkscreen.Generated.Top") = 0

                         dsp.Visible("Fabrication.Silkscreen.Part.Text.PartNumber.Top") = 0

                         dsp.Visible("Fabrication.Silkscreen.TestPoint.Probe.Top") = 0

                         dsp.Visible("Fabrication.Silkscreen.TestPoint.Text.RefDes.Top") = 0

                        

                         dsp.Visible("Fabrication.Silkscreen.Part.Outline.Top") = 1

                         dsp.Visible("Fabrication.Silkscreen.Part.Text.RefDes.Top") = 1

                        

                     Case 2    'bottom

                         gui.ActiveRouteLayer = doc.LayerCount

                        

                         dsp.Visible("Fabrication.SolderMask.Bottom") = 1

                         dsp.Visible("Fabrication.SolderMask.Top") = 0

                        

                         dsp.Option("Option.Fabrication.SilkscreenItems.Bottom") = 1

                         dsp.Option("Option.Fabrication.SilkscreenItems.Top") = 0

                        

                         dsp.Visible("Fabrication.Silkscreen.Generated.Bottom") = 0

                         dsp.Visible("Fabrication.Silkscreen.Part.Text.PartNumber.Bottom") = 0

                         dsp.Visible("Fabrication.Silkscreen.TestPoint.Probe.Bottom") = 0

                         dsp.Visible("Fabrication.Silkscreen.TestPoint.Text.RefDes.Bottom") = 0

                        

                         dsp.Visible("Fabrication.Silkscreen.Part.Outline.Bottom") = 1

                         dsp.Visible("Fabrication.Silkscreen.Part.Text.RefDes.Bottom") = 1

                        

                 EndSelect

         EndSelect

 

         gui.ActiveMode = 0

    

EndSub

 

This is not a direct answer to your question, and you have some head scratching ahead to figure out how to do what you want, but it will get you there eventually.


Viewing all articles
Browse latest Browse all 1329

Trending Articles



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