IDatabaseLayer

class IDatabaseLayer

Bases: ImpactCOMWrapperBase

Description:

Represents the layer information for a drawing stored in the database.

Wraps a COM object or another wrapper instance. Accepts: - A valid impact_object - An existing impact_com_wrapper_base-derived instance

property added_to_working

Gets added_to_working.

Description:

Indicates whether the layer has been added to the working project (since the last time the project was updated).

Remarks:

Introduced in Impact 7.0.0.28

Returns:

The value of added_to_working.

Return type:

added_to_working (bool)

property created_by

Gets created_by.

Description:

The user that created this layer.

Remarks:

Introduced in Impact 7.0.0.33

Returns:

The value of created_by.

Return type:

created_by (IUser)

property database_item

Gets database_item.

Description:

The database_item to which this layer belongs.

Remarks:

Introduced in Impact 7.0.0.13

Returns:

The value of database_item.

Return type:

database_item (IDatabaseItem)

property deleted

Gets Deleted.

Description:

Indicates the layer has been deleted from the project in a previous revision.

Returns:

The value of Deleted.

Return type:

deleted (bool)

property documents

Gets Documents.

Description:

An IDocuments collection representing all the documents associated with this item.

Remarks:

Introduced in Impact 9.0.0.83.

Returns:

The value of Documents.

Return type:

documents (IDocuments)

property from_master

Gets from_master.

Description:

Indicates if the layer is from a master project.

Returns:

The value of from_master.

Return type:

from_master (bool)

property guid

Gets GUID.

Description:

The GUID of the layer.

Returns:

The value of GUID.

Return type:

guid (str)

property key

Gets Key.

Description:

The key of the layer.

Returns:

The value of Key.

Return type:

key (int)

property locked

Gets Locked.

Description:

Indicates if the layer is locked from modification.

Returns:

The value of Locked.

Return type:

locked (bool)

property master_layer

Gets master_layer.

Description:

Returns an IDatabaseLayer object for the linked master layer

Remarks:

introduced in Impact 11.0.0.32

Returns:

The value of master_layer.

Return type:

master_layer (IDatabaseLayer)

property name

Gets Name.

Description:

The name of the layer.

Returns:

The value of Name.

Return type:

name (str)

property revisions

Gets Revisions.

Description:

A collection of IDatabaseLayerRevision objects representing all of the revisions of the layer.

Remarks:

Introduced in Impact 6.4.0.7 and 7.0.0.49.

Returns:

The value of Revisions.

Return type:

revisions (IDatabaseLayerRevisions)

property type

Gets Type.

Description:

The type of the layer.

Returns:

The value of Type.

Return type:

type (str)

property type_key

Gets type_key.

Description:

The key of the layer type.

Returns:

The value of type_key.

Return type:

type_key (int)

property user

Gets User.

Description:

The user that is currently modifying this drawing layer.

Returns:

The value of User.

Return type:

user (IUser)

property values

Gets Values.

Description:

An IDatabaseValues object used to read and write data to and from the database.

Remarks:

The Values object can be used to directly read/write database values, extreme care should be taken when using this object. If you wish to modify the database values of a working project or open item use the database_values member of the IDrawing or ILayer object instead.

Returns:

The value of Values.

Return type:

values (IDatabaseValues)

property version

Gets Version.

Description:

The version of the layer.

Returns:

The value of Version.

Return type:

version (int)

property working_location

Gets working_location.

Description:

The location of the working drawing file in the database.

Remarks:

This property returns the location of the working drawing file for the user modifying this drawing layer. You should check User before using this property. This property works with both File and BLOB databases. For a BLOB database the location is a temporary file in the Geometry Cache folder which will be deleted when the owning IDatabaseLayer object is destroyed. This property will work with the IServer however the database must be configured to use UNC names and the client must have access to the network location to access the file. This property is provided so that you can pass the drawing file to another component such as the Impact active_x control. Replacing or deleting the file in the location may result in a corrupt Impact database. Extreme care should be exercised when using this property.

Returns:

The value of working_location.

Return type:

working_location (str)

Examples:

refresh()
Description:

Refresh the layer information from the database.

save_guid_string()
Description:

Ensures that a GUID exists for this layer.

Remarks:

Introduced in Impact 5.1.5.1. A GUID is only created if one does not already exist.

save_thumbnail_to_file(file_name, file_format, create_thumbnail)
Description:

Saves the embedded thumbnail image to a file.

Remarks:

Introduced in Impact 6.2.0.10.

Parameters:
  • file_name (str) – Specifies full path of the new file.

  • file_format (ipFileFormat) – Specifies the format in which to save the file. This can be one of the following values from the enumeration ipFileFormat: ffBitmap ffJPG ffPNG ffMetafile ffTIFF

  • create_thumbnail (bool) – Specifies if a thumbnail image will be generated if one does not already exist.

Examples:

save_thumbnail_to_stream(file_format, create_thumbnail)
Description:

Saves the embedded thumbnail image to a stream.

Remarks:

Introduced in Impact 6.2.0.10. If an embedded thumbnail image does not exist in the drawing it is created if the method parameter create_thumbnail is true - this is potentially a slow operation as the drawing data must be retreived from the database. This method cannot be called from VBScript as it does not support the IStream interface. You may use this method from other COM clients such as .NET applications.

Returns:

This method returns an IUnknown interface but the interface also supports the IStream interface.

Parameters:
  • file_format (ipFileFormat) – Specifies the format in which to save the file. This can be one of the following values from the enumeration ipFileFormat: ffBitmap ffJPG ffPNG ffMetafile ffTIFF

  • create_thumbnail (bool) – Specifies if a thumbnail image will be generated if one does not already exist.

Examples