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

Modeless Command Angle, current status

$
0
0

I am interested in creating a shortcut key that will toggle the modeless command AA and AD, that is Line/Trace Angle from Any Angle to Diagonal Angle.

I've figured out how to set up a separate shortcut keys for each, but making one shortcut key that toggles between the two angle modes is different.  It requires knowing the current state of Angle Mode.

Is that information available?

 

I know there are several ways to affect the route angle:

 

Application.ExecuteCommand("Orthogonal Angle Mode")

Application.ExecuteCommand("Diagonal Angle Mode")

Application.ExecuteCommand("Any Angle Mode")

 

OR

 

Application.ExecuteCommand("Global Options")

OptionsDlg.ActiveTab = "Routing|General"

OptionsDlg.ActiveTab = "Design"

OptionsDlg.DesignDlg.LineTraceAngle = 2

OptionsDlg.DesignDlg.LineTraceAngle = 0

OptionsDlg.DesignDlg.LineTraceAngle = 1

OptionsDlg.Apply.Click()

OptionsDlg.Ok.Click()

 

OR

 

Application.ModelessCommand("a")

DlgModelessCmd.Command = "aa"

DlgModelessCmd.Command = "ad"

DlgModelessCmd.Command = "ao"

DlgModelessCmd.OnOk()

 

 

OR by typing the modeless commands

 

AA

AD

AO

 

I can also access the ROUTERFLAGS variable in the ASCII output file.

 

Accessing the ascii file is not reasonable because I'm trying to do this in real time.  Using the Options dialog box is an option but it is MUCH slower than using the modeless commands.(even in an automated way)  A macro will complete the modeless command sequence 10x faster than setting the angle mode via the Options dialog box.

 

This set of code works in a Macro to complete the Angle Diagonal Modeless command:

Application.ModelessCommand("a")

DlgModelessCmd.Command = "ad"

DlgModelessCmd.OnOk()

 

but when I try to wrap an If Then Else statement around that code it does not function.  I try to have the If statement access the information in the Options dialog box as follows:

If OptionsDlg.DesignDlg.LineTraceAngle = 2 Then

Application.ModelessCommand("a")

DlgModelessCmd.Command = "ad"

DlgModelessCmd.OnOk()

Else

Application.ModelessCommand("a")

DlgModelessCmd.Command = "aa"

DlgModelessCmd.OnOk()

End If

 

Does the Angle Mode status information exist in a place that I can access and use in the above If statement?

Or am I just not using the correct syntax to access the information in OptionsDlg.DesignDlg.LineTraceAngle?


Viewing all articles
Browse latest Browse all 4541

Trending Articles



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