CadViewInfo class

CadViewInfo class

Represents view information for CAD drawing.

The CadViewInfo type exposes the following members:

Constructors

Constructor Description
init Initializes a new CadViewInfo instance.

Methods

Method Description
to_string Returns a string that represents the current object. (inherited from ViewInfo)

Properties

Property Description
layers The list of layers contained by the CAD drawing.
layouts The list of layouts contained by the CAD drawing.
file_type The type of the file. (inherited from ViewInfo)
pages The list of pages to view. (inherited from ViewInfo)

Example

from typing import cast
from groupdocs.viewer import Viewer
from groupdocs.viewer.options import ViewInfoOptions
from groupdocs.viewer.results import CadViewInfo

def get_cad_info():
    with Viewer("sample.dwg") as viewer:
        info = viewer.get_view_info(ViewInfoOptions.for_html_view())
        cad_info = cast(CadViewInfo, info)

        print("File type:", cad_info.file_type)
        print("Pages count:", len(cad_info.pages))
        print("Layers:")
        for layer in cad_info.layers:
            print(f"  {layer.name} (visible={layer.visible})")
        print("Layouts:")
        for layout in cad_info.layouts:
            print(f"  {layout.name} ({layout.width}x{layout.height})")

if __name__ == "__main__":
    get_cad_info()

Guides

Task guides that use CadViewInfo:

See Also