Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

C#.net programme for nx 6

Status
Not open for further replies.

dhaval082

Mechanical
Joined
Jun 24, 2013
Messages
26
Location
IN
dear
i have to required program for the click button on refresh external spreadsheet which is available in nx 6 at
tools=> expression => refresh external spreadsheet
 
Dhaval082,

Here's a recorded journal of the operation (NX 9). If this doesn't work in NX 6 it means that the .Net api support for that function was not added until a later NX version.

Code:
using System;
using NXOpen;

public class NXJournal
{
  public static void Main(string[] args)
  {
    Session theSession = Session.GetSession();
    Part workPart = theSession.Parts.Work;
    Part displayPart = theSession.Parts.Display;
    // ----------------------------------------------
    //   Menu: Tools->Expressions...
    // ----------------------------------------------
    theSession.Preferences.Modeling.UpdatePending = false;
    
    NXOpen.Session.UndoMarkId markId1;
    markId1 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Expression");
    
    theSession.Preferences.Modeling.UpdatePending = false;
    
    int nErrs1;
    nErrs1 = theSession.UpdateManager.DoUpdate(markId1);
    
    // ----------------------------------------------
    //   Menu: Tools->Journal->Stop Recording
    // ----------------------------------------------
    
  }
  public static int GetUnloadOption(string dummy) { return (int)Session.LibraryUnloadOption.Immediately; }
}

HTH, Joe
 
dear sir
i use this code but some error like dll not found so please tell me how to run this code
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top