Is there a way to set attributes to Element according Element Template from attached dgnlib (C#) ?In 2016 Jan Šlegr wrote: "I guess there is no documented NET API available", may be after time...
I expect something like this:
ElementTemplateCollection elementTemplates = model.GetDgnFile().GetElementTemplates();ElementTemplate elementTemplate = elementTemplates.FindByName(<template group name>\<template name>);LineElement element = new LineElement(.....elementTemplate.Apply(element);
...or similar...
Thank you very much for your answer!
Jan Šlegr said:What product do you use? What version (exactly) do you use?
Closer specification: AddIn application for OpenRoads 10.08.01.33 (OpenRoads Designer CONNECT Release 2, update 8) with MicroStation 10.13. core, C# ,NET, VS2017Prof.
Jan Šlegr said:Where, in what discussion I wrote it? Why you do not link the discussion?
Here is that discussion...last article
Hi Stanislav,
Stanislav Konrád said:Closer specification
Well, they are not "closer specification", but mandatory (and often crucial) specifications. Whether used product is MicroStation or OpenRoads Designer changes the whole discussion often.
Stanislav Konrád said:Here is that discussion...last article
I think even when situation is better now, because templates were discussed several times, so at least a minimal knowledge base is available. But it's not perfect, because even in C++ API, MstnElementTemplateMgr structure methods are not described enough.
Stanislav Konrád said:...or similar...
I see a couple of misunderstandings in your expectation:
Stanislav Konrád said:Is there a way to set attributes to Element according Element Template from attached dgnlib (C#) ?
I think there is, but it requires some research and extra study, because I was not able to find any discussion about ElementTemplateMgr.
I recommend:
Stanislav Konrád said:I expect something like this:
Well, I think the workflow should be similar, but used classes and methods different. And it's not quite clear from available documentation, how much of some tasks are done automatically and what have to be implemented.
I am not sure whether the element has to be added to a model before the template is assigned. Also, it makes sense to encapsulate the operations by single transaction to ensure it's represented as one step in MicroStation interface.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point