Hallo Trudel,
unter http://support.ugs.com/ gibt's jede Menge Beispiele für NXOpen in verschiedenen Sprachen, u.a. C#, siehe Beispiel unten.
C# - Tutorials kenn' ich leider keine, zu VB findet man einiges - auch in guter Qualität, z.B. bei www.activevb.de . Da müsste es für C# ja auch irgendwo was geben.
Daneben gibt's hier im Forum einige Einsteiger- Beiträge. Und die Hilfe im Visual Studio ist auch nicht von schlechten Eltern - nur leider ohne Bezug zu NX.
Gruß, Michael
Subject: Sample NX Open .NET C# program : prompt for number input
Note: GTAC provides programming examples for illustration only, and
assumes that you are familiar with the programming language being
demonstrated and the tools used to create and debug procedures. GTAC
support professionals can help explain the functionality of a particular
procedure, but we will not modify these examples to provide added
functionality or construct procedures to meet your specific needs.
using System;
using NXOpen;
using NXOpenUI;
class prompt_for_number_input
{
public static void Main()
{
Session s = Session.GetSession();
ListingWindow lw = s.ListingWindow;
UI ui = UI.GetUI();
string initStr = "12,5";
double newValue;
try
{
newValue = NXInputBox.GetInputNumber("Enter value",
"Enter value", initStr);
}
catch (Exception ex)
{
// use NXMessageBox starting with NX5
NXMessageBox msgbox = ui.NXMessageBox;
msgbox.Show("Oops", NXMessageBox.DialogType.Error, "No valid input...exit");
// pre-NX5 use this:
// lw.Open(); lw.WriteLine(ex.Message);
return;
}
lw.Open();
lw.WriteLine("You entered: " + newValue + Environment.NewLine);
}
public static int GetUnloadOption(string arg)
{
return System.Convert.ToInt32(Session.LibraryUnloadOption.Immediately);
}
}
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP