Hi Everyone!
I am using verson of MicroStation Connection. For example I have a model (aka sheet) and it has several (4) attaches. In the sheet I see them as Viewports.
Is there a way to get each viewport and iterate through them?
If there is no such method, is it possible to get the boundaries of each viewport in the drawing (as a 2D point) and then for each of them get a 3D point in the model space?
Thank you!
Dmitry Soldatenkov said:Is there a way to get each viewport and iterate through them?
I can't see a .NET way to do that. C++ has classes that didn't make it into .NET yet. For example...
IndexedViewportP vp = IViewManager::GetActiveViewSet().GetViewport(0);
Regards, Jon Summers LA Solutions
Dear Jon,
Thank you for your answer!
May I ask a clarifying question? Let’s say the drawing (sheet) contains 4 named views on one page, (each named view as attached model), how can I get the viewport each of named view?
Dmitry Soldatenkov said:can I get the viewport each of named view?
There's NamedView.GetViewPortInformation.
NamedView.GetViewPortInformation
DgnFile.GetNamedViews, NamedViewCollection and NamedViewEnumerator you probably already discovered.
DgnFile.GetNamedViews
NamedViewCollection
NamedViewEnumerator
Thank you Jon,
I am afraid, but Viewportinfo something different. I attached the drawing image for example. I meant on it 4 viewports (1,2,3,4) each as separate attached model. Each has borderline. Can I get 2D coordinates those boxes in paper space?
Now I just got them as :
var coll = model_sheet.GetElements().Where(e => (e is Bentley.DgnPlatformNET.Elements.Type2Element));
But also I need to find the way convert them into 3D model space. If I had a Viewport structure, that would be a lot easier. Maybe I can do it another way?
I believe they are attachments of this sheet model. Can you send me your DGN file and I can do a programming test.
Thank you Yongan!
The problem is already solved. It can be done by inverse transform from attached.
Answer Verified By: Yongan.Fu
Good to know.