KernelCAD Documentation

DInsight Home
Skip Navigation Links.
Start page
Quick Start
Installation
Overview of the software
What is new
Collapse KernelCAD ModelsKernelCAD Models
Collapse KernelCAD ComponentsKernelCAD Components
KernelCAD Control
KernelCAD .NET Control
Methods and Properties
Menu
Model Explorer
Birds Eye View
Programming
Direct User Access
Direct Operations
Interface Queries
Printing Support
Data Types
Modes of KernelCAD Control
DIObjectGenerator class
Properties
FlatObjectArray Poperty
Context
64 bit development
Dual Mode
Initialisation Context
Overlay Editor
Memory Management
Input validation
Collapse Advanced functionalityAdvanced functionality
Collapse InterfacesInterfaces
Alphabetical list
I3DGrid
I3DBugger
I3Dpt
IAxiBase
IAxis
IBoolSection
IBoolSectionEx
IBoundary
IColor
IConstraint
IData
IDiffSurface_KC
IDIFont
IDraw
IDrawUtil
IDraw2
IElem
IElement
IKCLine
ILightSource
ILocation
ILocationEx
IMaterial
IMetrics
IMetrics2
IModel
IModel2
IModelEx
IPatch
IKCPathCollisionDetector
IProfiles
IPropertyArray
IPropertyArray2
IStdShape
IStrip
ISurface
IText
ITexture
ITransform
IUnknown
Collapse Open Cascade TechnologyOpen Cascade Technology
Collapse DataData
Collapse MovementMovement
Collapse FramesFrames
Collapse Oriented ObjectsOriented Objects
Collapse SectionsSections
Collapse GeneralGeneral
Collapse Topological InterfacesTopological Interfaces
Collapse Viewing InterfacesViewing Interfaces
Collapse Lines And CurvesLines And Curves
Collapse Symmetry InterfacesSymmetry Interfaces
Collapse Clipping plane interfacesClipping plane interfaces
Collapse AlgorithmsAlgorithms
Collapse 2D Geometry2D Geometry
Collapse Programming Samples and TutorialsProgramming Samples and Tutorials
Collapse OverviewOverview
Collapse DeploymentDeployment
Collapse .NET Samples.NET Samples
Collapse C++ SamplesC++ Samples
Collapse Visual Basic SamplesVisual Basic Samples
Collapse Delphi SamplesDelphi Samples
Collapse 3D Debugger3D Debugger
Collapse DeploymentDeployment
Licensing
Model Viewer
Open C++ Source
Technical Support
Skip Navigation LinksHome Page > KernelCAD Components > Interfaces > Viewing Interfaces > IPrint_KC
IPrint_KC Interface

IPrint_KC Interface

PrintView
GetDefaults
Print
PrintToFile
Get2DView
StartDocument
EndDocument

IPrint_KC provides access to printing of two dimensional views. IPrint_KC can be queried from IView via: KernelCAD > GetView > IView > IPrint_KC

See also Interface List


HRESULT PrintView(EPageOrientation orientation)

Parameters

orientation - [in] Orientation of the printed page

Remarks:

The methods prints the current KernelCAD window with paper orientation specified by the parameter. If orientation is eOrientAuto the view will be printed with portrait orientation if height of the window is greater than its width and with landscape orientation otherwise.


HRESULT GetDefaults(PrintContext_KC* options)

Parameters

options - [out] PrintContext_KC structure to be initialized

Remarks:

The methods acts as a constructor for PrintContext_KC structure. It initializes its members with default values.


HRESULT Print(PrintContext_KC* options)

Parameters

options - [in] PrintContext_KC additional options for printing. See remarks.

Remarks:

The method prints the view with the specified options.

validOrientation, validPaperSize, validMargin and validScale determine whether the correspondent parameters have valid data and should not be ignored.

orientation - Orientation of the printed page. If orientation is eOrientAuto the view will with portrait orientation if height of the window is greater than its width and with landscape otherwise

paperSize - Selection of the paper size

marginHorizontal, marginVertical - Margins for the printout. Must be greater than 0 and less than 1. Used only if validMargin is true and scale is negative or zero.. This option allows controlling amount of white space around the drawing.

The actual margins are calculated as next: Drawing size is calculated as the longest side if the minimal bounding rectangle containing the drawing. Margin on the left hand edge will be equal to marginHorizontal*(Drawing size). Margin on the right hand edge will be equal to the margin on the left hand side. Analogously the vertical margin will be calculated as marginVertical*(Drawing size).

Margins are ignored when scale is positive even if validMargin is true

scale - If scale is negative the image will be fit with maximal size into the page. Otherwise the model will be printed with the specified scale. For example if scale is 1.0  lengths measured on paper will coincide with lengths specified in the model.. If scale is 2.0 the printed model will have double size on paper. There are no warnings when scaled image does not fully fit the page. The image will be printed clipped in this case.


HRESULT PrintToFile(char* szFilePath, float aspect, PrintContext_KC* options)

Parameters

szFilePath - [in] Full path of the file with an .emf or .wmf extension to save the drawing to

 aspect - Aspect ratio of the rectangle (width divided by height) where the emf file will be displayed or a non-positive number to use default. See remarks.

options - [in] PrintContext_KC additional options for printing. See remarks. for Print method above.

Remarks:

This method is available only in 2D mode. It saves the current 2D drawing to a Extended Windows Metafile or Windows Metafile. The drawing is positioned and scaled to fit best a rectangle with aspect ratio aspect inside a document.

If aspect is zero or negative it will be calculated automatically as aspect ration of the minimal rectangle, containing the drawing.


HRESULT Get2DView(I2DView_KC **view)

Parameters

view - [out, retval] The returned I2DView_KC interface implemented by printing view

Remarks:

This method is available only in 2D mode. It gives access to printing view


HRESULT StartDocument)

Remarks:

Call before starting a sequence of PrintToFile() calls to optimize performance. The method allocates and cashes some additional resources used in consequent calls to PrintToFile().


HRESULT EndDocument)

Remarks:

Call in the end of a sequence of PrintToFile() calls to free resources allocates with a cal to StartDocument()