Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • 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
Jun 24, 2013
26
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
 
Replies continue below

Recommended for you

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