- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi
i want to take image of specific element which is zoom.
able to zoom by below:
UIApp.ActiveUIDocument.ShowElements(oEid);
And getting image of document by below:
using (Transaction tx = new Transaction(UIApp.ActiveUIDocument.Document))
{
tx.Start("Export Image");
string desktop_path = Environment.GetFolderPath(
Environment.SpecialFolder.Desktop);
Autodesk.Revit.DB.View view = UIApp.ActiveUIDocument.Document.ActiveView;
string filepath = Path.Combine(desktop_path,
view.Name);
ImageExportOptions img = new ImageExportOptions();
img.ZoomType = ZoomFitType.Zoom;
img.PixelSize = 96;
img.ImageResolution = ImageResolution.DPI_600;
img.FitDirection = FitDirectionType.Horizontal;
img.ExportRange = ExportRange.CurrentView;
img.HLRandWFViewsFileType = ImageFileType.PNG;
img.FilePath = filepath;
img.ShadowViewsFileType = ImageFileType.PNG;
UIApp.ActiveUIDocument.Document.ExportImage(img);
filepath = Path.ChangeExtension(filepath, "png");
Process.Start(filepath);
tx.Commit();
}
By this getting image of all element present in that specific view.As below image.
want to get image of specific zoom element how could i get that?
(code for image copied from forum where jeremy has answered for one of query.)
Solved! Go to Solution.