I use microstation 08.11.09.578, DGN 2D V7 Upgrade V8I use C# language
When fitview it will align the mapI want to get the polygon coordinates that wrap the inner lines like the green line, is it possible?
Bentley.Interop.MicroStationDGN.View v = app.ActiveDesignFile.Views[1]; Point3d point = v.get_Origin(); Point3d point2 = v.get_Center();
The code I tried but not as expected
ba ranh said:I use MicroStation 08.11. I use C# language.
When you write C# code for MicroStation V8i, you're using an InterOp to call the VBA COM interface.
ba ranh said:I want to get the polygon coordinates that wrap the inner lines
Every graphic DGN element has a range (VBA Range3d), which you can obtain using Element.Range. You can scan a DGN model to get its elements, and then calculate the intersection of all element ranges. If you're trying to get all elements in a DGN model, then ModelReference.Range is a faster way to get what you want.
Range3d
Element.Range
ModelReference.Range
A convex hull is analogous to an elastic band stretched around a set of DGN elements. I've described a way to generate a convex hull in MicroStation. However, that requires a different programming language (C++ or C#) — VBA is not up to the task.
Regards, Jon Summers LA Solutions
When pressing fitview, all points will fit in one screenI want to get the point3d List of four corners like the image
ba ranh said:I want to get the point3d List of four corners like the image
Did you bother to try Jon's advice? When in base position (not rotated), ElementRange provides exactly this information (the surrounding box, expressed in UOR's precision). As Jon wrote, you can analyze individual element ranges, or to use the whole model element range.
When you want to implement, get view extent after the drawing is fitted in the view.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
I have obtained all the coordinate pointsI want to get the coordinates like the green line drawn like in the image
ba ranh said:I have obtained all the coordinate points
What points, using what code?
Unfortunately, it is pretty useless information when you do not share any code snippet, explaining how you obtain data.
ba ranh said:I want to get the coordinates like the green line drawn like in the image
It is exactly what ModelReference.Range describes. Or, can be alternatively extracted from ranges of all elements in model.
Regards,