Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

journal identify action button

Status
Not open for further replies.

Zoes

Mechanical
Sep 30, 2011
46
GB
Hi there,

I was wondering if the action of hitting a menu button, can be identified in code instead of having a commentary?

"// Menu: Insert->Sketch Curve->Circle..."?

public static void Main(string[] args)
{
Session theSession = Session.GetSession();
Part workPart = theSession.Parts.Work;
Part displayPart = theSession.Parts.Display;
[highlight #FCE94F] // ----------------------------------------------
// Menu: Insert->Sketch Curve->Circle...
// ----------------------------------------------[/highlight]
NXOpen.Session.UndoMarkId markId1;
markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Profile short list");

NXOpen.Session.UndoMarkId markId2;
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Curve");


Thank you in advance,
Z.
 
Replies continue below

Recommended for you

Perhaps need to clarify things by saying action button;

The idea is to create a custom toolbar.exe which will have some menus existing already in UGS NX (e;g like sketch, colour palette etc.).
Is that possible? I do know the path making custom menus and toolbars (.men .tlr) but this time using journals NX Open I want to make it an .exe so I can incorporate additional code.

Please see code below,

Any help appreciated,
Z.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NXOpen;
using NXOpen.UF;
using NXOpen.UIStyler;
using System.Threading;
using System.IO;

namespace projectx78
{
public partial class toolbar_form : 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 static class coder
{}
public static class Common
{}
public toolbar_form()
{
InitializeComponent();
}

private void sketch_sth_Click(object sender, EventArgs e)
{

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

NXOpen.Session.UndoMarkId markId1;
NXOpen.Session.UndoMarkId markId2;

markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Profile short list");
markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Invisible, "Create Rectangle");
theSession.SetUndoMarkVisibility(markId2, "Create Rectangle", NXOpen.Session.MarkVisibility.Visible);

}
}
}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top