获取外部引用的块属性值

获取块属性值

Aspose.CAD for .NET API 允许您获取块属性的外部引用。 Aspose.CAD API 暴露 XRefPathName 属性,以获取 CadBlockDictionary 集合中块属性的外部引用。以下是获取块属性的外部引用的代码演示。

// The path to the documents directory.
string MyDir = RunExamples.GetDataDir_DWGDrawings();
string sourceFilePath = MyDir + "sample.dwg";
// Load an existing DWG file as CadImage.
using (Aspose.CAD.FileFormats.Cad.CadImage cadImage = (Aspose.CAD.FileFormats.Cad.CadImage)Aspose.CAD.Image.Load(sourceFilePath))
{
System.Console.WriteLine(cadImage.BlockEntities["*MODEL_SPACE"].XRefPathName);
}