Hi,
my question is about the best workflow in V8i, but I think the same can be asked for CE implementation, so I included both versions in the subject.
I have DGN file with references (often) and more models in the main DGN file (sometimes). Some elements in models contain data in custom format, partially depending on extrernal data sources. I need to publish DGN file to i-model package including the custom data. During the conversion, the original files have to remain unchanged.
What is a recommended workflow and best practice? I do not ask how to convert custom data to "i-model supported format", this part is implemented already, I am able to create EC schema(s) based on custom data structures and to attach EC data to elements, and it works fine. My question is about how to manipulate with elements, models and references.
One alternative I have thoguht about is to make a copy of the whole structure, do necessary data conversion, and to use i-model API (imodelPublisher class etc.) to publish model(s) with references.
I read i-model Primer in MicroStation Programmer Guide, but I think I do not understand well enough the description when work DGN file should be used and how references are supported in the described workflow. When I simplify the workflow described in the guide, it's:
What I miss in the description is when to rewert changes (I guess when i-model publishing is finished) and also (more important) when and how to modify more models in opened DGN file and attached references.
With regards,
Jan
Hi Jan,
I will need to investigate a few options and if needed I may need to check with the MicroStation iModel publishing developer with a proposed workflow/solution to this workflow.
Thank you,Bob
Hi Bob,
it would be great.
I think to copy everything to temp structure > convert > publish temp files > delete everything will work fine, but there are also some not so nice features:
... and it seems MicroStation uses a different approach, because references are published at background, but it's not clear whether the process can be hooked using API.
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
We do have (4) imodel publishing related examples in the MicroStation CONNECT SDK, though I presume have seen/reviewed these already but if not please take a quick look:
Most recent examples
Older examples
I will keep you posted and thank you for mentioning ProjectWise likely to be involved,
Bob
Robert Hook said:We do have (4) imodel publishing related examples in the MicroStation CONNECT SDK, though I presume have seen/reviewed these already
Well, I did, but it was some time ago, so I will do it again ;-)
My two comments are that for now I have to implement it on V8i, because API to obtain external has not been ported to CE yet. But it will be, so there is also option to use some simpler (like copy everything out) in V8i and to do it better and more integrated in CE later.
What I remember (but it's something I will have to check again) the examples do not demonstrate how to work with reference attachments including modificaiton of existing elements with new data.
Regards,
Like you have mentioned while publishing the file MS traverse through all the reference attachments and publish them all. So currently there is no API which you can use to publish reference individually. But I would like to understand the use case where you need an API to publish the references.
But if you want package some document with iModel then we have the APIs for that and that is EmbedDocumentsInPackage (WString documentName) which you can use to embed the document.
Thanks,
Mahendra
Hi Mahendra,
thanks for you answer. My question is not about to publish references individually. I will try to explain my situation and needs using a simplified example:
... so it's about "just an average design file" ;-)
Some elements in the main model and attached references contain custom data. Even though the format is different, you can imagine it as mslinks to external system. Using this data and proprietary API, it's possible to retrieve further information relevant to a particular element.
Important feature is that the data are not "i-model compatible", because of the format itself (XAttributes are used) and they are partially stored outside DGN file. A requirement is to provide the same information in i-model files too, which requires to convert the custom data into EC format, before or as a part of publishing process. A mandatory requirement is that original files (active and references) cannot be modified. My question is what is the best way to achieve it in V8i and (in future) in CONNECT Edition.
I am able (implemented in C#):
I am also able to call i-model publishing API through C++/CLI from my Addin application.
A solution I am working on, is:
Two disadvantages I see here (but have not analyzed them in detail yet) are:
But maybe there is some other way:, e.g. to obtain every element before it's published to i-model, through existing API.
From SDK documentation I understand I can use mdlUndo_mark to be able to modify active model (add EC data) and to keep the original file unchanged. But the same approach cannot be used for references...
I will check existing examples in EC SDK, regardless my main effort is still V8i platform, because the functionality is planned to migrate to CE also.
My current plan is to implement the mentioned simple approach (to offer i-model publishing process quickly) and to improve implementation incrementally.
Thank you for clarifying the workflow with Mahendra, myself, and others. One question that may help provide an additional workflow or options...
The final published iModel: should it be WYSIWYG (from original design - view) and could it be "flattened" (all elements stored in only one model w/proprietary data stored in EC form)?