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

Re: toggle items in display control

$
0
0

I run the following script for that particular function.  It's in a .vbs file I call from my keybindings file. It's the old way, but still works with VX. 

 

Optionexplicit

 

dim app

dim doc

 

Set app = GetObject(, "MGCPCB.Application")

Call Scripting.AddTypeLibrary("MGCPCB.Application")

 

' get the (licenced) active document

Set doc = GetLicensedDoc(app)

 

Ifnot doc isnothingthen

    

     if doc.activeview.DisplayControl.MiscItems(0) = Truethen

         doc.activeview.DisplayControl.MiscItems(0) = False

     else

         doc.activeview.DisplayControl.MiscItems(0) = True

     Endif

    

    

 

Endif

 

Set app = Nothing

Set doc = Nothing

 

 

 

PublicFunction GetLicensedDoc(appObj)

  . . .

EndFunction

 

 

If you want the new way, for VX releases, you'll have to search through the DisplayControl.xls file's vba code to find the right way to identify every object's setting.  In this case it would be something like:

 

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

 

where dsp is the display control object. 

 

The DisplayControl.xls file can be found in

 

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

 

Last time I looked (several months ago) the help files on SupportNet for the display control were severely lacking, and in some parts completely wrong.  I'm not sure if they've updated it since then. It will take you a lot of searching and scratching your head with that vba code to figure out how to use automation with the new display control.  It's not particularly intuitive. 


Viewing all articles
Browse latest Browse all 4541

Trending Articles



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