Trabajando con Hipervínculos
Contents
[
Hide
]Actualizar Hipervínculo en un DWG
Aspose.CAD para .NET te permite acceder al hipervínculo en un dibujo de AutoCAD utilizando el CadBaseEntity.Hyperlink. Puedes acceder a cada hipervínculo de esta colección uno por uno y editar sus propiedades.
Código de Ejemplo
El siguiente código de ejemplo accede a todas las entidades de la imagen y cambia su propiedad Hyperlink a la página web de Aspose.
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
// The path to the documents directory. | |
string MyDir = RunExamples.GetDataDir_DWGDrawings(); | |
string dwgPathToFile = MyDir + "AutoCad_Sample.dwg"; | |
using (CadImage cadImage = (CadImage)Image.Load(dwgPathToFile)) | |
{ | |
foreach (CadBaseEntity entity in cadImage.Entities) | |
{ | |
if (entity is CadInsertObject) | |
{ | |
CadBlockEntity block = cadImage.BlockEntities[((CadInsertObject)entity).Name]; | |
if (!string.IsNullOrEmpty(block.XRefPathName.Value)) | |
{ | |
block.XRefPathName.Value = "new file reference.dwg"; | |
} | |
} | |
if (entity.Hyperlink == "https://products.aspose.com") | |
{ | |
entity.Hyperlink = "https://www.aspose.com"; | |
} | |
} | |
} | |