.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Hyperlink programmatically editing

1 REPLY 1
Reply
Message 1 of 2
Anonymous
453 Views, 1 Reply

Hyperlink programmatically editing

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

1 REPLY 1
Message 2 of 2
BKSpurgeon
in reply to: Anonymous

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

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost