Hi,
I need to display an image of an element (a cell to be precise) in a form. I VBA there is element.GetPicture() but I cannot find something similar in .NET.
There are the ElementGraphicsProcessor and ElementGraphicsOutput but I cannot figure out if thats the way to go.
/Krister
Unknown said:There are the ElementGraphicsProcessor and ElementGraphicsOutput but I cannot figure out if thats the way to go
Probably not. Assuming that they are wrappers around C++ methods of the same name, then ElementGraphicsProcessor is a way to build facet collections from element geometry. It's part of iModel production, where the resulting DGN is viewable without the need for an app., such as AECOSim, to render specific constructions. The 'picture' mentioned in the documentation is still vector data.
ElementGraphicsProcessor
Why not call the VBA method element.GetPicture()?
Regards, Jon Summers LA Solutions
The example in the VBA documentation shows how to access DrawToEnhancedMetafile method from C#.
cellElement = app.CreateCellElement3 (cellName, ref zeroOrigin, true);System.IntPtr metafileHandle = new IntPtr(cellElement.DrawToEnhancedMetafile (100, 100, false));System.Drawing.Imaging.Metafile metafile = new System.Drawing.Imaging.Metafile (metafileHandle, true);cellPreview.Image = metafile;
How can I get the app object from a running Bentley.MstnPlatformNET.AddIn app?
Owner consultant at Surell Consulting AB
using System.Runtime.InteropServices;
Bentley.Interop.MicroStationDGN.Application app = Bentley.MstnPlatformNET.InteropServices.Utilities.ComApp;