Working with Hyperlinks
Contents
[
Hide
]Update Hyperlink in a DWG
Aspose.CAD for Python allows you to access the hyperlink in an AutoCAD drawing using the CadBaseEntity.Hyperlink. You can access each hyperlink from this collection one by one and edit its properties.
Sample Code
The following sample code accesses all the entities of the image and changes their Hyperlink property to the Aspose website.
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
import aspose.cad as cad | |
from aspose.pycore import cast | |
image = cad.fileformats.cad.CadImage.load("file.dwg") | |
castedDgnImage = cast(cad.fileformats.cad.CadImage, image) | |
for entity in castedDgnImage.entities: | |
if(entity.hyperlink == 'https://products.aspose.com'): | |
entity.hyperlink = 'https://www.aspose.com' |