Hyperlink programmatically editing

Hyperlink programmatically editing

Anonymous
Not applicable
607 Views
1 Reply
Message 1 of 2

Hyperlink programmatically editing

Anonymous
Not applicable

Hello everyone,

I'm trying to change a hyperlink description using VB.NET

following is the code:

 

Using acLockCurrDoc As DocumentLock = acDoc.LockDocument()
 Using acTrans As Transaction = acCurDb.TransactionManager.StartTransaction()

 

    Dim MyEntity As Entity = CType(acTrans.GetObject(MyObjID, OpenMode.ForWrite), Entity)
    Dim hyperlinkColl As HyperLinkCollection = MyEntity.Hyperlinks
    Dim hyperL As HyperLink = hyperlinkColl.Item(0)

    hyperL.Description =" Some description"

 

    acTrans.Commit()

 

 End Using
End Using

 

Stepping through the code in debug mode, after passing hyperL.Description =" Some description" row, the Description property of the hyperlink is
effectively modified as I can see from the variable window of VisualStudio, but when I go to the drawing in order to verify if the modification have taken place, the hyperlink description was not modified.

Any suggestion?
Thanks alot in advance.

Luigi

0 Likes
608 Views
1 Reply
Reply (1)
Message 2 of 2

BKSpurgeon
Collaborator
Collaborator

Please show/demonstrate how you have determined that the hyperlink description was not updating?

 

Some ideas:

  • Double check you are not incorrectly looking at the hyperlink name rather than the hyperlink description, when you are checking. Or Try changing the name and see if that produces the change you are after.
  hyperL.Name =" Some name"
  • double check you are looking at the correct entity (clear the drawing of all other entities) for testing purposes.
  • Try checking programmatically whether the change has taken place with some more code.

HTH

0 Likes