create Hyperlink programmatically

How to create hyperlink and attach to an element in VBA?

Regards,

Jeffrey Kam

Parents
  • Engineering Links

    If by Hyperlink you mean an Engineering Link then it's done using tags. MicroStation uses a tag set named 'Internet' that contains tag definitions 'URL' and 'description' plus some others. MicroStation's Engineering Links tool will interpret tags created with that tag set and follow the hyperlink contained in the URL tag.

    With VBA, you create tags in the usual way using the 'Internet' tag set definition.

    Regards, Jon Summers
    LA Solutions

     
    Regards, Jon Summers
    LA Solutions

  • I did with the code followings

    TagSet tagset = app.ActiveDesignFile.TagSets.Add("Internet");

    TagDefinition tag = tagset.TagDefinitions.Add("URL", MsdTagType.msdTagTypeCharacter);

    tag.DefaultValue = "www.google.com";

    tag = tagset.TagDefinitions.Add("description", MsdTagType.msdTagTypeCharacter);

    elm.Current.AddTag(tag);

    elm.Rewrite();

    but it seems not work, what's wrong with my code?

    Regards,

    Jeffrey

Reply
  • I did with the code followings

    TagSet tagset = app.ActiveDesignFile.TagSets.Add("Internet");

    TagDefinition tag = tagset.TagDefinitions.Add("URL", MsdTagType.msdTagTypeCharacter);

    tag.DefaultValue = "www.google.com";

    tag = tagset.TagDefinitions.Add("description", MsdTagType.msdTagTypeCharacter);

    elm.Current.AddTag(tag);

    elm.Rewrite();

    but it seems not work, what's wrong with my code?

    Regards,

    Jeffrey

Children