首页上一页 1 下一页尾页 1 条记录 1/1页
关于UG二次开发的C#问题
发表在C#图书答疑
2009-09-21
是否精华
是
否
版块置顶:
是
否
下面是一个关于UG二次开发的问题:先创建两点再创建一条直线
问题:怎样才能UG里才能掉用
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NXOpen;
using NXOpen.Utilities;
using NXOpen.UF;
using NXOpenUI;
using NXOpen.Features;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private Point3d p1;
private Point3d p2;
/// <summary>
/// 选择第一点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
p1 = new Point3d(0,0,0);
}
/// <summary>
/// 选择第二点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
p2 = new Point3d(10, 10, 10);
}
/// <summary>
/// 创建直线
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
Session.GetSession().Parts.Work.Curves.CreateLine(p1,p2);
}
}
}
问题:怎样才能UG里才能掉用
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using NXOpen;
using NXOpen.Utilities;
using NXOpen.UF;
using NXOpenUI;
using NXOpen.Features;
namespace WindowsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private Point3d p1;
private Point3d p2;
/// <summary>
/// 选择第一点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button1_Click(object sender, EventArgs e)
{
p1 = new Point3d(0,0,0);
}
/// <summary>
/// 选择第二点
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button2_Click(object sender, EventArgs e)
{
p2 = new Point3d(10, 10, 10);
}
/// <summary>
/// 创建直线
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void button3_Click(object sender, EventArgs e)
{
Session.GetSession().Parts.Work.Curves.CreateLine(p1,p2);
}
}
}