Methods

Navigation:  Interfacing QDV7 > CRMs y ERPs > Modelo componente de la interfaz de QDV >

Methods

Previous pageReturn to chapter overviewNext page

QDVInterface

 

 

Initialize()

 

This function must be called once to initialize the component. No other function can be called until Initialize() is called.

It returns nothing but you can check the property IsInitialized to know if your component is initialized.

It supports the parameter "Silent". When it is set to True, no message is posted; collect all messages using the function GetMessagesStack().

Example in the Multi-languages sample>Overhead workbook>Sample Function.

 

 

GetEstimate(ByVal FullPathToEstimate As String, ByRef ErrorMessage As String, ByVal ForReadOnly As Boolean) As Estimate

 

This function returns an Estimate object which enables reading and writing to the estimate file referred to as FullPathToEstimate. Calling   operations on it.

 

INPUT

FullPathToEstimate is a string containing the full path to an estimate from which you want to get a reference, including the name of the estimate. Ie: c:\my_directory\my_estimate.qdv.

ErrorMessage is a variable string set to blank intended to return an error message if any.

ForReadOnly is a boolean. If true, you won't be able to save the estimate to its original location / name. When you open an estimate for read only, it opens even if it is already in use. When this flag is set to false, you get an error if you attempt to open an estimate which is already in use.

WorkOnOriginalEstimate is a boolean. When you set it to true, you directly work on the original file but at no risk because until you explicitly save the estimate, you don’t alter the original estimate regardless of the changes brought to it by the component. Otherwise, the function expands the estimate to a temporary file for handling. Use this boolean to re-compute an estimate connected to a management database or to ProMo+, which requires a live link.

 

OUTPUT

ErrorMessage returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

GetEstimate is an Estimate object derived from the Estimate class which enables reading and writing from / to the estimate

 


 

QDVInterface.Estimate

 

 

CloseEstimate() As String

 

This function closes the estimate object and frees corresponding resources.

 

OUTPUT

CloseEstimate returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

 

 

ExtractBOQ(FullPathToTargetFile As String, Format As XLFormat, GetOriginal As Boolean, Optional ByVal Version As String = "") As String

 

This function saves the BoQ workbook if any from the estimate to the specified location. You can select the version of the estimate from which the BoQ workbook is saved.

The function exports the BoQ workbook filled by QDV but doesn't export the native BOQ workbook (the original file used to create the BoQ) which can be stored in the estimate.

 

INPUT

FullPathToTargetFile is a string which contains the full path to target, including directory and file name. Ie: c:\my_directory\my_workbook.xlsx.

Format is an integer value defined as follows:

0 = Open XML (xlsx - Excel 2007 and above)

1 = Biff8 (xls - Excel 2003)

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the workbook from the current version is extracted (the version being on top). When a value is provided, the workbook from specified version is extracted. If the version doesn't exist, an error message is returned. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

ExtractBOQ returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

 

 

ExtractOverhead(ByVal FullPathToTargetFile As String, ByVal Format As XLFormat, Optional ByVal Version As String = "") As String

 

This function saves complete overhead workbook from the estimate to the specified location. You can select the version of the estimate from which the overhead workbook is saved.

 

INPUT

 

FullPathToTargetFile is a string which contains the full path to target, including directory and file name. Ie: c:\my_directory\my_workbook.xlsx.

 

Format is an integer value defined as follows:

0 = Open XML (xlsx - Excel 2007 and above)

1 = Biff8 (xls - Excel 2003)

 

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the workbook from the current version is extracted (the version being on top). When a value is provided, the workbook from specified version is extracted. If the version doesn't exist, an error message is returned. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

ExtractOverhead returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

 

ExtractWBS(ByVal FullPathToTargetFile As String, ByVal Format As XLFormat, Optional ByVal Version As String = "") As String

 

This function saves complete WBS workbook from the estimate to the specified location. You can select the version of the estimate from which the WBS workbook is saved.

INPUT

 

FullPathToTargetFile is a string which contains the full path to target, including directory and file name. Ie: c:\my_directory\my_workbook.xlsx.

 

Format is an integer value defined as follows:

0 = Open XML (xlsx - Excel 2007 and above)

1 = Biff8 (xls - Excel 2003)

 

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the workbook from the current version is extracted (the version being on top). When a value is provided, the workbook from specified version is extracted. If the version doesn't exist, an error message is returned. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

ExtractWBS returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

 

 

Function GetCollectionOfVersions() As String()

 

This function returns a table of string containing all versions letters of the estimate. The current version (Top version) returns a blank string. So an estimate having no version stored will return a table of one line with a blank string while an estimate having versions A and B recorded would return a table of three lines: one blank string, one with A and one with B.

 

OUTPUT

GetCollectionOfVersions returns a table of type string containing each version as letters ranging from A to ZZ. It also return always one blank row for the current version. Returns Nothing if it fails.

 

 

 

GetGlobalVariableNames(Optional ByVal Version As String = "") As String()

 

This function returns a table of string containing all global variable names. It includes all variables GLV_, PMP_, MGT_, SYS_ etc. It returns one global variable name per line.

 

OUTPUT

GetGlobalVariableNames returns a table of type string containing each global variable name. Returns Nothing if it fails or if no global variable is found.

 

 

 

GetGlobalVariableNumber(ByVal VariableName As String, ByRef ErrorMessage As String, Optional ByVal Version As String = "") As Double

 

This function returns the value being stored to variable whose name is provided. Returns ErrorMessage in plain text when it fails. Use GetGlobalVariableType to make sure the variable returns a number.

 

INPUT

 

VariableName is the name of the variable you want to get the value. This name is not case sensitive (GLV_MyVariable = glv_myvariable). The variable name must exist in the estimate. Use GetGlobalVariableNames to know which variable exist in an estimate.

 

ErrorMessage is a variable string set to blank intended to return an error message if any.

 

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the global variable is read from the current version (the version being on top). When a value is provided, it is read from this version. If the version doesn't exist, the function fails and returns -1. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

 

ErrorMessage returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

GetGlobalVariableNumber returns a float which contains the value of the variable.

 

 

GetGlobalVariableText(ByVal VariableName As String, ByRef ErrorMessage As String, Optional ByVal Version As String = "") As Double

 

This function returns the value being stored to variable whose name is provided. Returns ErrorMessage in plain text when it fails. Use GetGlobalVariableType to make sure the variable returns a text string.

 

INPUT

 

VariableName is the name of the variable you want to get the value. This name is not case sensitive (GLV_MyVariable = glv_myvariable). The variable name must exist in the estimate. Use GetGlobalVariableNames to know which variable exist in an estimate.

ErrorMessage is a variable string set to blank intended to return an error message if any.

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the global variable is read from the current version (the version being on top). When a value is provided, it is read from this version. If the version doesn't exist, the function fails and returns -1. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

 

ErrorMessage returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

GetGlobalVariableNumber returns a string which contains the value of the variable.

 

 

GetGlobalVariableType(ByVal VariableName As String, Optional ByVal Version As String = "") As Integer

 

This function returns 0 when variable whose name is provided is a string and 1 when it is a number. Returns -1 on error.

 

INPUT

 

VariableName is the name of the variable you wish to know the type. This name is not case sensitive (GLV_MyVariable = glv_myvariable). The variable name must exist in the estimate. Use GetGlobalVariableNames to know which variable exist in an estimate.

 

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the global variable is read from the current version (the version being on top). When a value is provided, it is read from this version. If the version doesn't exist, the function fails and returns -1. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

 

GetGlobalVariableType returns 0 when variable name receives a string, 1 when it receives a number and -1 on error.

 

 

 

GetMappingForMinutes(ByRef ErrorMessage As String) As QDVInterface.Mapping()

 

This function returns a table or QDVInterface.Mapping whose count of rows is the count of fields being in the minutes. You must call it and indicate which field our want to return from the estimate using the ReadField variable of the object before you pass it to the GetDataFromMinutes() function.

NOTE Mapping is the same for all versions of an estimate so you cannot pass the version to this function.

 

INPUT

ErrorMessage is a variable string set to blank intended to return an error message if any.

 

OUTPUT

ErrorMessage returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

GetMappingForMinutes returns a table of QDVInterface.Mapping() objects containing columns definition of the minutes.

 

 

 

GetMappingForNomenclatures(ByRef ErrorMessage As String) As QDVInterface.Mapping()

 

This function returns a table or QDVInterface.Mapping whose count of rows is the count of fields being in the nomenclatures. You must call it and indicate which field our want to return from the estimate using the ReadField variable of the object before you pass it to the GetDataFromNomenclatures() function.

NOTE Mapping is the same for all versions of an estimate so you cannot pass the version to this function.

 

INPUT

ErrorMessage is a variable string set to blank intended to return an error message if any.

 

OUTPUT

 

ErrorMessage returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

GetMappingForNomenclatures returns a table of QDVInterface.Mapping() objects containing columns definition of the nomenclatures.

 

 

 

GetMappingForWBS(ByRef ErrorMessage As String) As QDVInterface.Mapping()

 

This function returns a table or QDVInterface.Mapping whose count of rows is the count of fields being in the WBS. You must call it and indicate which field our want to return from the estimate using the ReadField variable of the object before you pass it to the GetDataFromWBS().

NOTE Mapping is the same for all versions of an estimate so you cannot pass the version to this function.

 

INPUT

ErrorMessage is a variable string set to blank intended to return an error message if any.

 

OUTPUT

 

ErrorMessage returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

GetMappingForWBS returns a table of QDVInterface.Mapping() objects containing columns definition of the WBS.

 

 

 

IsGlobalVariableWritable(ByVal VariableName As String, Optional ByVal Version As String = "") As Integer

 

This function returns 1 when global variable whose name is provided is writable. Returns 0 when it is not writable. Returns -1 on error.

NOTE: The function always returns 0 when you provide a version because, to prevent changes to recorded version, you cannot write any variable to them.

 

INPUT

 

VariableName is the name of the variable you wish to know if it is writable. This name is not case sensitive (GLV_MyVariable = glv_myvariable). The variable name must exist in the estimate. Use GetGlobalVariableNames to know which variable exist in an estimate.

 

Version is a string (Optional) ranging A-ZZ or left blank. When left blank or omitted, the global variable is read from the current version (the version being on top). When a value is provided, it is read from this version. If the version doesn't exist, the function fails and returns -1. Use GetCollectionOfVersions to know which version exist in the estimate file.

 

OUTPUT

IsGlobalVariableWritable returns 1 when the variable is writable, otherwise returns 0. Returns -1 when it fails.

 

 

 

SaveEstimate(ByVal RemoveInformationToManagementDatabase As Boolean, Optional ByVal FullPath As String = "") As String

 

This function saves your change to the estimate file the object refers to or to another estimate file. If you got a reference to your estimate trough GetEstimate() with a ForReadOnly attribute, you won't be able to save the estimate to its original location.

 

INPUT

RemoveInformationToManagementDatabase is a boolean. When true, the estimate looses links to the management database meaning that its PMP_ or MGT_ global variables won't be any longer updated from the management database an it won't push data any longer to the management database. It's safe to set this flag when you record an estimate having a link to a management database to another location. If you don't do it, you may have two different files referring to same record of the management database.

 

FullPath (Optional) is a string containing the full path to an estimate file to which you want to save to. Ie: c:\my_directory\my_estimate.qdv. If the file exists, it is overwritten by the function. If FullPath is omitted, estimate is saved to the file it was open from or the file specified during the last saving operation.

 

OUTPUT

SaveEstimate returns a string containing the error message in plain text if any. If the function succeed, this value is left blank.

 

 

 

SetGlobalVariableNumber(ByVal VariableName As String, ByVal Value As Double) As String

 

This function writes a numeric value to the global variable whose name is provided. Returns a plain text error message when it fails. Version cannot be selected through this function because you cannot write data to a stored version. This function always apply to the current version.

If the variable doesn't exist, it is created by the function. If the variable type was Text, it is changed to Numeric by the function.

NOTE: You can only write to user defined and management global variables so, your variable name must always start by PMP_ (ProMo+ Management), MGT_ (Basic Management) or GLV_ (User defined). Any attempt to write to a system variable SYS_ returns an error message.

 

INPUT

 

VariableName is the name of the variable you wish to write to. This name is not case sensitive (GLV_MyVariable = glv_myvariable). The variable name must exist in the estimate. Use GetGlobalVariableNames to know which variable exist in an estimate.

 

Value is the numeric value you want to write to the global variable.

 

OUTPUT

 

SetGlobalVariableNumber returns a string containing the error message in plain text if any. If the function succeed, the function returns a blank string.

 

 

 

SetGlobalVariableText(ByVal VariableName As String, ByVal Text As String) As String

 

This function writes a text value to the global variable whose name is provided. Returns a plain text error message when it fails. Version cannot be selected through this function because you cannot write data to a stored version. This function always apply to the current version.

If the variable doesn't exist, it is created by the function. If the variable type was Numeric, it is changed to Text by the function.

NOTE You can only write to user defined and management global variables so, your variable name must always start by PMP_ (ProMo+ Management), MGT_ (Basic Management) or GLV_ (User defined). Any attempt to write to a system variable SYS_ will return an error message.

 

INPUT

 

VariableName is the name of the variable you wish to write to. This name is not case sensitive (GLV_MyVariable = glv_myvariable). The variable name must exist in the estimate. Use GetGlobalVariableNames to know which variable exist in an estimate.

 

Value is the text value you want to write to the global variable.

 

OUTPUT

 

SetGlobalVariableNumber returns a string containing the error message in plain text if any. If the function succeed, the function returns a blank string.