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

Re: How to distinguish 'Plow Mode' and to 'get the trace object' selected during plow mode?

$
0
0

Hi,

 

I could almost get there starting from Juergen's code.

But I don't have idea how to use 'OnChar' Event. Can anyone pls help with it?

 

---------------------------------

Option Explicit 

Dim pcbApp
Set pcbApp = Application

 

Dim com, oID
set com = pcbApp.gui.commandlistener

 

Dim pcbDoc
Set pcbDoc = pcbApp.ActiveDocument

 

ValidateServer(pcbDoc)
Scripting.AddTypeLibrary("MGCPCB.ExpeditionPCBApplication")

 

Call Scripting.AttachEvents(pcbDoc, "doc")
Call Scripting.AttachEvents(pcbApp, "app")
Call Scripting.AttachEvents(com, "com")

Function com_PostOnCommand(name, id)
oID = ID
End function

dim mtraces,oWidth
function com_PreOnMouseClk(eButton, eFlags, dX , dY)
If eButton = epcbMouseButtonLeft Then
  If oID = "33064" then
   set mtraces = pcbDoc.traces(epcbSelectSelected)
   If mtraces.count = 1 then   
    oWidth = mTraces.item(1).Geometry.LineWidth
   Else
    'MsgBox mtraces.count
   End If
  End If
End If
End function

 

 

function doc_OnChar(nChar)
If nChar = "+" Then
MsgBox "o"
  If oWidth = 0.1 Then
   pcbApp.Gui.ProcessKeyin("cw 0.15")
  ElseIf oWidth = 0.15 Then
   pcbApp.Gui.ProcessKeyin("cw 0.20")
  End If
End If
End Function


Viewing all articles
Browse latest Browse all 4541

Trending Articles



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