الحصول على مراجع للملفات الخارجية

كيفية الحصول على مراجع للملفات الخارجية

المشكلة: كيفية الحصول على مراجع للملفات الخارجية (CADNET-110).

نصائح: للحصول على مراجع للملفات الخارجية للرسوم في كتلة الكيان، هناك حقل XRef PathName لصور الراستر يتم استخدام CadRasterImage Def للتراكب الخارجي و CadDgnUnderlay تُستخدم وحقل UnderlayPath لها.

مثال:

External drawing:
foreach (CadBaseEntity baseEntity in image.Entities)
{
// if entity is a block
if (baseEntity.TypeName == CadEntityTypeName.INSERT)
{
CadInsertObject insert = (CadInsertObject)baseEntity;
CadBlockEntity block = image.BlockEntities[insert.Name];
// get external reference to object
System.Console.WriteLine(block.XRefPathName);
}
}
External raster image:
foreach (CadBaseObject baseObject in image.Objects)
{
// if entity is an image definition
if (baseObject.TypeName == CadObjectTypeName.IMAGEDEF)
{
CadRasterImageDef rasterImageDef = (CadRasterImageDef)baseObject;
// get external reference to object
System.Console.WriteLine(rasterImageDef.FileName);
}
}
External underlay:
foreach (CadBaseEntity baseEntity in cadImage.Entities)
{
if (baseEntity.TypeName == CadEntityTypeName.DGNUNDERLAY) // or DWFUNDERLAY, or PDFUNDERLAY
{
CadDgnUnderlay dgnFile = (CadDgnUnderlay)baseEntity; // or CadDwfUnderlay, or CadPdfUnderlay
System.Console.WriteLine(dgnFile.UnderlayPath);
}
}