In MicroStation, it's possible, using mouse context menu, attach a link (URL, key-in, to specific file) to an element:
When the link is attached, proper icon (URL in this case) is displayed:
Using NET API (where DgnLink API does not exist ;-), I am able to query the link and to receive the link properties, but I did not find a way, how to create the link.
I checked how it can be done in C++, but I found no clear description. There is DgnLink struct and also DgnLinkManager::CreateLink method, but I have no idea how they should be used (and even whether they are the right classes ;-)
I do not need to create a link in LinkSet, only to attach the link to selected element.
Is there any code snippet available?
With regards,
Jan
Hi Bentley Developer Team.I would also be very interested in the answer! It should not be to difficult to add a link to an element, without the old TAG-technique, or?
Thanks a lot!
Mit freundlichen Grüßen / Best regards Volker Hüfner
| AB_DATE Engineering Software | ab-date.de |
Hi Jan,
Does this example from Yongan.Fu provide you with the information you need?https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/216871/v8i-add-and-delete-design-links-within-a-cellelement/661455#661455
Based on Barry Lothian pointed out thread, key lines need to be changed as below:
auto leaf = DgnLinkManager::CreateLink(status, DGNLINK_TYPEKEY_URLLink); DgnLinkP link = leaf->GetLinkP(); DgnURLLinkP urlLink = dynamic_cast<DgnURLLinkP>(link); urlLink->SetAddress(L"http://www.bentley.com");
Answer Verified By: Jan Šlegr
Hi Barry,
Barry Lothian said:Does this example from Yongan.Fu provide you with the information you need?
thanks for providing the link. I searched !too much" for "URL link", that I evidently missed something valuable ;-)
Regards,
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
HI Yongan,
Yongan.Fu said:Based on Barry Lothian pointed out thread, key lines need to be changed as below:
thanks a lot for the code snippets, I will try it :-)