×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

NXOpen MenuBar MenuButton

NXOpen MenuBar MenuButton

NXOpen MenuBar MenuButton

(OP)
Hi there,

Any ideas mapping menu buttons to c# with NXOpen? I thick I'm on the right track but I'm not sure. The code below tries to map the menu button "Create Rectangle" to a window forms button:

namespace sth
{
public partial class Someform : Form
{
public NXOpen.UI theUI = NXOpen.UI.GetUI();
public Session theSession = Session.GetSession();
public UFSession theUfSession = UFSession.GetUFSession();
public NXOpen.Session.UndoMarkId Id2;
public int nErrs1;
public DisplayModification displayModification1;
public Part workPart;
public Part displayPart;
public NXOpen.MenuBar.MenuButton myButton;

public Someform()
{
InitializeComponent();

workPart = theSession.Parts.Work;
displayPart = theSession.Parts.Display;

NXOpen.MenuBar.MenuButton myButton = theUI.MenuBarManager.GetButtonFromName("Create Rectangle");
this.myButton = form_btn;

}

private void form_btn_Click(object sender, EventArgs e)
{

try
{
// Update part
theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Create Rectangle");
nErrs1 = theSession.UpdateManager.DoUpdate(Id2);

lw.WriteLine("button clicked" + "\r\n");
}
catch (Exception ex)
{
MessageBox.Show("Error is : " + ex);
}
}
}}

RE: NXOpen MenuBar MenuButton

(OP)
Anyone?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources