PdcProjectLineList.AddCalculationCopy: Difference between revisions

From External Bemet Wiki
Jump to navigation Jump to search
No edit summary
 
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:


== Notes ==
== Notes ==
The copied calculation is always an identical copy without any update of prices and surcharges.
The copied calculation is always an identical copy without any update of prices and surcharges.<br>
This work exactly like [[pdcCalculations.Copy]]. If you want to update charges, you can call [[pdcCalculation.UpdatePricesAll]]
Its works exactly like [[pdcCalculations.Copy]]. If you want to update charges, you can call [[pdcCalculation.UpdateChargesAll]]


== Code example ==
== Code example ==


<source lang="vb">
<source lang="VB.Net">
dim objProject
dim project as pdcEXT.IProject
dim objPJLine
dim projectLine as pdcEXT.IProjectLine


   set objProject = pdc.projects.active
   project = PDC.App.Projects.Active
   set objPJLine = objProject.ProjectLineList.AddCalculationCopy("01351")
   if project isnot Nothing then
  if IsValid(objPJLine) then
    projectLine = project.ProjectLineList.AddCalculationCopy("01351")
    msgbox "The calculation is copied."
    if projectLine isnot Nothing then
  else
      msgbox("The calculation is copied.")
    msgbox "The copy of the calculation is failed."
    else
      msgbox("The copy of the calculation is failed.")
    end if
    project.Refresh
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(projectLine)
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(project)
   end if
   end if
  objProject.Refresh
</source>
</source>


== Availability ==
== Availability ==
Available since February 2011 (From version 4.2 onwards).
Available since February 2011 (From version 4.2 onwards). The Copy calculation screen is shown.<br>
25-7-2014 in version 4.3 onwards: The copy calculation screen is suppressed and an identical copy is made.

Latest revision as of 14:00, 2 August 2023

Declaration

AddCalculationCopy(ACalcNr as String) as PdcProjectLine

Description

Copy the applied calculation always as a new projectline.

Notes

The copied calculation is always an identical copy without any update of prices and surcharges.
Its works exactly like pdcCalculations.Copy. If you want to update charges, you can call pdcCalculation.UpdateChargesAll

Code example

dim project as pdcEXT.IProject
dim projectLine as pdcEXT.IProjectLine

  project = PDC.App.Projects.Active
  if project isnot Nothing then
    projectLine = project.ProjectLineList.AddCalculationCopy("01351")
    if projectLine isnot Nothing then
      msgbox("The calculation is copied.")
    else
      msgbox("The copy of the calculation is failed.")
    end if
    project.Refresh
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(projectLine)
    System.Runtime.InteropServices.Marshal.FinalReleaseComObject(project)
  end if

Availability

Available since February 2011 (From version 4.2 onwards). The Copy calculation screen is shown.
25-7-2014 in version 4.3 onwards: The copy calculation screen is suppressed and an identical copy is made.