如何求实体的交点?
C#开发|冯美娟|2018-07-25 15:13
-
回答:
private void testIntersectWith() { // 选择实体。] axMxDrawX1.Prompt("选择求交实体."); MxDrawSelectionSet ss = new MxDrawSelectionSet(); ss.Select(MCAD_McSelect.mcSelectionSetUserSelect, null, null); if (ss.Count == 0) return; if (ss.Count == 1) { MessageBox.Show("选择两个实体"); return; } MxDrawEntity ent0 = (MxDrawEntity)ss.Item(0); MxDrawEntity ent1 = (MxDrawEntity)ss.Item(1); MxDrawPoints pts = ent0.IntersectWith(ent1, MCAD_McExtendOption.mcExtendNone); if (pts.Count == 0) return; for (int i = 0; i < pts.Count; i++) { MxDrawPoint pt = pts.Item(i); axMxDrawX1.DrawVectorCircle(pt.x, pt.y, 100, 255); } }