การเข้าถึงจุดยอดของ polyline และ 3DFace
Contents
[
Hide
]วิธีการเข้าถึงจุดยอดของ polyline และ 3DFace
ปัญหา: วิธีการเข้าถึงจุดยอดของ polyline และ 3DFace (CADNET-88).
คำแนะนำ: เพื่อเข้าถึงจุดยอดของเส้นที่ขาดและหน้าต่าง 3D คุณจำเป็นต้องใช้เอนทิตีในแบบเพื่อเข้าถึงเส้นที่ขาดหรือ 3D face.
ตัวอย่าง:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
foreach (CadBaseEntity baseEntity in cadImage.Entities) | |
{ | |
if (baseEntity.GetType() == typeof(CadPolyline)) | |
{ | |
CadPolyline polyline = (CadPolyline)baseEntity; | |
foreach (CadBaseEntity childEntity in polyline.ChildObjects) | |
{ | |
if (childEntity.TypeName == CadEntityTypeName.VERTEX) | |
{ | |
Cad2DVertex vertex = (Cad2DVertex)childEntity; | |
System.Console.WriteLine("Coords = " + vertex.LocationPoint.X + " " + vertex.LocationPoint.Y + " " + vertex.LocationPoint.Z); | |
} | |
} | |
} | |
} | |
foreach (CadBaseEntity baseEntity in cadImage.Entities) | |
{ | |
if (baseEntity.GetType() == typeof(Cad3DFace)) | |
{ | |
Cad3DFace cad3DFace = (Cad3DFace)baseEntity; | |
System.Console.WriteLine("First point = " + cad3DFace.FirstCorner.X + " " + cad3DFace.FirstCorner.Y); | |
System.Console.WriteLine("Second point = " + cad3DFace.SecondCorner.X + " " + cad3DFace.SecondCorner.Y); | |
System.Console.WriteLine("Third point = " + cad3DFace.ThirdCorner.X + " " + cad3DFace.ThirdCorner.Y); | |
System.Console.WriteLine("Forth point = " + cad3DFace.FourthCorner.X + " " + cad3DFace.FourthCorner.Y); | |
} | |
} |