使用截面构建器控件的选择意图设置选项比曲线收集器多了几个,主要对应在相交处停止、跟随圆角、特征内成链相关的设置。
截面构建器控件获取选择的曲线集:
//截面构建器控件获取选择的曲线集
List<ICurve> sectionElementList = new List<ICurve>();//用于存放选择的曲线
TaggedObject[] taggedObjects = section0.GetProperties().GetTaggedObjectVector("SelectedObjects");
Section section = taggedObjects[0] as Section; //获取选择构建器
SectionData[] sectionDatas;
section.GetSectionData(out sectionDatas);//获取选择器中的数据,选择一次产生SectionData
for (int i = 0; i < sectionDatas.Length; i++)
{
SectionElementData[] sectionElementDatas;
sectionDatas[i].GetSectionElementsData(out sectionElementDatas);//获取SectionData的SectionElementData对象
for (int j = 0; j < sectionElementDatas.Length; j++)
{
ICurve sectionElement, startConnector, endConnector;
Point3d startPoint, endPoint;
//获取SectionElementData中的曲线
sectionElementDatas[j].GetSectionElementData(out sectionElement, out startConnector, out startPoint, out endConnector, out endPoint);
if (!sectionElementList.Contains(sectionElement))
sectionElementList.Add(sectionElement);//存放曲线
}
}
//注意:设置选择范围为整个装配时,选择获取的曲线是当前工作部件的原型,而非曲线的occ对象