Diagram class

Diagram class

Root element of Visio objects hierarchy.

The Diagram type exposes the following members:

Constructors

Constructor Description
Diagram()
Diagram(filename) Public class constructor,
loads the diagram from the file.
Diagram(stream) Public class constructor,
loads the diagram from the stream.
Diagram(filename, format) Public class constructor,
loads the diagram from the file using predefined format.
Diagram(stream, format) Public class constructor,
loads the diagram from the stream using predefined format.
Diagram(filename, options) Public class constructor,
loads the diagram from the file using predefined load file options.
Diagram(stream, options) Public class constructor,
loads the diagram from the stream using predefined load file options.

Properties

Property Description
start Indicates whether the document has been modified outside of Visio.
If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.
key Indicates whether the document has been modified outside of Visio. If present, Visio will fully test the contents of the file. Omit for files you create outside of Visio.
metric Whether to use metric units in the drawing. Set this attribute to True (1) to use metric units; set it to False (0) to use English units.
buildnum The build number of the Visio instance used to create the document.
version The version number of the Visio instance. Microsoft Visio 2010 = 14.
doc_lang_id The unique ID of the user-interface language the user has specified in Microsoft Office 2010 Language Preferences.
style_sheets Collection StyleSheet objects.
masters Collection Master objects.
pages Collection Page objects.
document_props Contains document property elements such as the document’s title, author, and so on.
document_settings Contains elements that specify document settings.
colors Contains the document’s color table. Each document contains a single color table,
which lists the 24 standard colors that are available for application to objects
such as shapes, text, and layers in the document.
fonts Contains a collection of Font elements
document_sheet Specifies a document’s ShapeSheet structure.
active_page Specifies the active page
windows Contains the Window elements for a document.
event_items Contains an EventItem element for each event to which an object should respond.
header_footer Contains elements for a document’s header and footer.
vb_project_data Contains the Microsoft Visual Basic for Applications project data in MIME (Multipurpose Internet Mail Extensions) encoded format.
email_routing_data Contains a MIME (Multipurpose Internet Mail Extensions) encoded MAPI e-mail routing slip for the document.
data_connections Contains the DataConnection elements for the document.
data_record_sets The collection of DataRecordset objects associated with a Document object.
ribbon_x The Ribbon XML string that is passed to the document to customize the ribbon user interface.
user_custom_ui The Ribbon XML string that is passed to the document to customize the Quick Access toolbar or the ribbon.
validation Stores information about diagram validation for the document.
solution_xm_ls XML value.
vba_project Gets the VbaProjectDiagram.vba_project.
interrupt_monitor Gets and sets the interrupt monitor.

Methods

Method Description
save(filename, format) Saves the diagram data to the file.
save(stream, format) Saves the diagram data to the stream.
save(filename, options)
save(stream, options)
export(input_vsd, output_vdw) Exports the diagram from vsd to vdw format. Not implemented yet.
export(input_vsd, output_vdw) Exports the diagram from vsd file to vdw stream format. Not implemented yet.
export(input_vsd, output_vdw) Exports the diagram from vsd stream to *.vdw file format. Not implemented yet.
export(input_vsd, output_vdw) Exports the diagram from vsd stream to vdw stream format. Not implemented yet.
add_master(src_diagram, master_name)
add_master(template_stream, master_name) Adds master to diagram from template stream by master’s Name or NameU.
add_master(template_stream, master_id) Adds master to diagram from template stream by master’s ID.
add_master(template_file_path, master_name) Adds master to diagram from template file by master’s Name or NameU.
add_master(template_file_path, master_id) Adds master to diagram from template file by master’s ID.
add_shape(new_shape, master_name, page_number) Adds shape created by master to specific page.
add_shape(pin_x, pin_y, master_name, page_number) Adds shape created by master on page with defined PinX and PinY.
add_shape(pin_x, pin_y, width, height, master_name, page_number) Adds shape created by master on page with defined PinX,PinY,Width and Height.
print(options)
print() Prints the whole document to the default printer.
print(printer_name) Print the whole document to the specified printer,using the standard (no User Interface) print controller.
print(printer_name, options)
print(printer_settings, options)
print(printer_settings) Prints the document according to the specified printer settings,using the standard (no User Interface) print controller.
print(printer_settings, document_name, options)
print(printer_settings, document_name) Prints the document according to the specified printer settings,using the standard (no User Interface) print controller and a document name.
print(printer_name, document_name, options)
print(printer_name, document_name) Prints the document,using the standard (no User Interface) print controller and a document name.
copy_theme(source)
combine(second_diagram)
refresh() Invokes Refresh method for all DataRecordSet in the Diagram.
layout(options)
has_hidden_info() Indicates whether this diagram has hidden information.
remove_hidden_information(item) Remove unused information
get_unused_styles() Get unused Styles
get_default_font_dir() Get the Default Fonts folder path
remove_macro() Removes VBA/macro from this diagram.

See Also