public void Create_Linear_List()
{
FeatureSigns block_sign;
FeatureSigns Cylinder_sign;
FeatureSigns Sign_Nullsign = FeatureSigns.Nullsign;
FeatureSigns Sign_Negative = FeatureSigns.Negative;
double[] abc ={40.0,40.0,3.0, //长方体长\宽\高
4.0,1.0, //圆柱高\直径 线性
3.0,2.0,4.0,2.0};//线性阵列 X方向个数\距离 Y方向个数\距离
//长方体和圆柱体的尺寸参数
double[] orig1 = { -20.0, -20.0, 0.0 }; //长方体的原点
double[] orig2 = { 5.0, 5.0, 0.0 }; //圆柱体的原点
Cylinder_sign = Sign_Negative; //表示圆柱体
block_sign = Sign_Nullsign; //表示长方体
int m = 1;//Z轴矢量方向
int method = 0;
double[] block_orig = { orig1[0], orig1[1], orig1[2] };
double[] cyl_orig = { orig2[0], orig2[1], orig2[2] };
string[] block_len = new string[3];
string[] bb = new string[3];
string cyl_height;
string cyl_diam;
string[] cc = new string[2];
double[] direction = { 0, 0, m };
string number_in_x;
string distance_x;
string number_in_y;
string distance_y;
string[] dd = new string[4];
Tag blk_obj;
Tag cyl_obj_id;
Tag[] feature_list;
Tag feature_obj_id;
bb[0] = Convert.ToString(abc[0]);
bb[1] = Convert.ToString(abc[1]);
bb[2] = Convert.ToString(abc[2]);
block_len[0] = bb[0];
block_len[1] = bb[1];
block_len[2] = bb[2];
theUfSession.Modl.CreateBlock1(block_sign, block_orig, block_len, out blk_obj);
cc[0] = Convert.ToString(abc[3]);
cc[1] = Convert.ToString(abc[4]);
cyl_height = cc[0];
cyl_diam = cc[1];
theUfSession.Modl.CreateCyl1(FeatureSigns.Negative, cyl_orig, cyl_height, cyl_diam, direction, out cyl_obj_id);
dd[0] = Convert.ToString(abc[5]);
dd[1] = Convert.ToString(abc[6]);
dd[2] = Convert.ToString(abc[7]);
dd[3] = Convert.ToString(abc[8]);
number_in_x = dd[0];
distance_x = dd[1];
number_in_y = dd[2];
distance_y = dd[3];
theUfSession.Modl.CreateList(out feature_list);
theUfSession.Modl.PutListItem(ref feature_list, cyl_obj_id);
theUfSession.Modl.CreateLinearIset(
method, //线性阵列的方法
number_in_x,//X方向阵列的数量
distance_x, //X方向阵列的距离
number_in_y,//Y方向阵列的数量
distance_y, //Y方向阵列的距离
feature_list,//阵列特征的链表
out feature_obj_id//创建的阵列特征的标识
);
//圆形阵列
double[] location = { 0.0, 0.0, 0.0 };
double[] axis = { 0.0, 0.0, 1.0 };
string number_str = "12";
string angle_str = "30";
theUfSession.Modl.CreateCircularIset(
method, //阵列方法
location, //阵列矢量点
axis, //阵列矢量
number_str,//阵列数量
angle_str, //旋转角度
feature_list,//阵列特征链表
out feature_obj_id);//创建阵列特征标识
return;
} |