CS_NXOpen_0001_Cylinder
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace NXCylinder
{
public class Class1
{
public static void Main(string[] args)
{
NXOpen.Session theSession =
NXOpen.Session.GetSession();
NXOpen.Part workPart =
theSession.Parts.Work;
NXOpen.Part displayPart =
theSession.Parts.Display;
//
----------------------------------------------
// Menu: Insert->Design
Feature->Cylinder...
//
----------------------------------------------
NXOpen.Features.Feature
nullNXOpen_Features_Feature = null;
NXOpen.Features.CylinderBuilder
cylinderBuilder1;
cylinderBuilder1 =
workPart.Features.CreateCylinderBuilder(nullNXOpen_Features_Feature);
cylinderBuilder1.Diameter.RightHandSide = "200";
cylinderBuilder1.Height.RightHandSide
= "20";
NXOpen.Axis axis1;
axis1 = cylinderBuilder1.Axis;
NXOpen.Point3d origin1 = new NXOpen.Point3d(0.0, 0.0, 0.0);
NXOpen.Vector3d vector1 = new NXOpen.Vector3d(0.0, 1.0, 0.0);
NXOpen.Direction direction1;
direction1 =
workPart.Directions.CreateDirection(origin1, vector1, NXOpen.SmartObject.UpdateOption.WithinModeling);
axis1.Direction = direction1;
NXOpen.Point3d coordinates5 = new NXOpen.Point3d(100.0, 100.0,
100.0);
NXOpen.Point point5;
point5 =
workPart.Points.CreatePoint(coordinates5);
NXOpen.Point point6;
point6 = axis1.Point;
axis1.Point = point5;
NXOpen.NXObject nXObject1;
nXObject1 =
cylinderBuilder1.Commit();
cylinderBuilder1.Destroy();
}
public static int GetUnloadOption(string dummy) { return (int)NXOpen.Session.LibraryUnloadOption.Immediately; }
}
}
Comments
Post a Comment