Setting up the Renderer

Global rendering properties such as dimensions, source, and destination of the rendered image are set through an AcDbRenderGlobal object, obtained from the ACAD_RENDER_GLOBAL dictionary. Settings specific to the mental ray renderer are set through an AcDbRapidRTRenderSettings object, obtained from the ACAD_RENDER_ACTIVE_RAPIDRT_SETTINGS dictionary.

AcDbRenderGlobal::setProcedureAndDestination() is used to set the source and destination for rendering. You can choose to render a selected portion of the view, the complete view, or just a selection of objects. The destination of the rendered image can be set to the render window or to the viewport. Save the rendered image to a file by first enabling the save file flag using setSaveEnabled(), and specifying the file name using setSaveFileName().

After configuring the settings, call one of the render commands (RENDER or RENDERCROP) to render the image.