Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

CopyItem

Text:

API Call:Creates a copy of Item under Parent and returns the ID of the new item.

If IncludeChildren is true, child items will be copied also.

If SkipSections is true, digitized sections will be duplicated also.

Syntax:

Function: CopyItem(Item: String; Parent: String; IncludeChildren: boolean; SkipSections: boolean): String;

Code Reference:

    • 1. Create a New Form application
    • 2. Add a button to the form
    • 3. add Planswift to reference (Planswift9_tlb in the uses)
    • 4. copy code to button onclick event

API Calls

Delphi

Code Block
languagedelphi
themeRDark
firstline1
titleUsing IItem Object Model
linenumberstrue
collapsetrue
procedure pscopyitem;
var
  ps: IPlanSwift;
  itm: IItem;
  est: IItem;
begin
  //Create the Planswift Interface
  ps := coplanswift.Create;
  //Get the estimating tab
  est := ps.GetItem('Job\Path');
  //Get the Selected Item
  itm := ps.SelectedItem;
  //Copy the selected item to the estimating tab
  //with all child items and sections
  ps.CopyItem(itm.GUID,est.GUID,True,False);
  //free planswift interface
  ps := nil;
end;


Code Block
languagedelphi
firstline1
titleUsing PlanSwift Object Model
linenumberstrue

C#

Code Block
languagec#
themeRDark
firstline1
titleUsing IItem Object Model
linenumberstrue


Code Block
languagec#
themeRDark
firstline1
titleUsing PlanSwift Object Model
linenumberstrue

VB/VBA (OLE)

Code Block
languagevb
firstline1
titleUsing IItem Object Model
linenumberstrue


Code Block
languagevb
firstline1
titleUsing PlanSwift Object Model
linenumberstrue

Pascal Scripting (OLE)

Code Block
firstline1
titleItem Object Model
linenumberstrue


Code Block
titleRoot Object Model
linenumberstrue

Pascal Scripting

Code Block
firstline1
titleItem Object Model
linenumberstrue


Code Block
titleUsing the PlanSwift Object Model
linenumberstrue