...
Function
: ResultAsString:
String
;
API
...
Calls
Delphi
Code Block |
---|
language | delphi |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using IItem Object Model |
---|
linenumbers | true |
---|
collapse | true |
---|
|
procedure psPropertyResults;
var
ps: IPlanSwift;
itm: IItem;
txt: string;
propString: String;
propFloat: Extended;
PropInt: Integer;
propvariant: OleVariant;
prop: IPropertyObject;
begin
//Create the Planswift Interface
ps := coPlanswift.Create;
//Get the Selected item
itm := ps.SelectedItem;
//IF no Item is selected then exit
if varisclear(itm) then begin
showMessage('Please Select an Item');
ps := nil;
exit;
end;
//Get the parent Item
itm := itm.parentItem;
//Get the name Property as a string
prop := itm.GetProperty('Type');
propString := prop.ResultAsString;
//Get the Qty value as Float or Extended
prop := itm.GetProperty('Linear Total');
propFloat := prop.ResultAsFloat;
//Get the Point Count as an Integer
prop := itm.GetProperty('Point Count');
PropInt := prop.ResultAsInteger;
//Get Takeoff Value as a Variant
prop := itm.GetProperty('Linear Total');
propvariant := prop.ResultAsVariant;
//Set Text and Show Message
txt := 'Property Type String: ' + propString + #13#10;
txt := txt + 'Property Linear Total Float: ' + FloatToStr(propFloat) + #13#10;
txt := txt + 'Property Point Count Integer: ' + IntToStr(propInt) + #13#10;
txt := txt + 'Property Linear Total Variant: ' + varToStr(propvariant) + #13#10;
ShowMessage(txt);
//Free Planswift Interface
ps := nil;
end; |
Code Block |
---|
language | delphi |
---|
firstline | 1 |
---|
title | Using PlanSwift Object Model |
---|
linenumbers | true |
---|
|
|
C#
Code Block |
---|
language | c# |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using IItem Object Model |
---|
linenumbers | true |
---|
|
|
Code Block |
---|
language | c# |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using PlanSwift Object Model |
---|
linenumbers | true |
---|
|
|
VB/VBA (OLE)
Code Block |
---|
language | vb |
---|
firstline | 1 |
---|
title | Using IItem Object Model |
---|
linenumbers | true |
---|
|
|
Code Block |
---|
language | vb |
---|
firstline | 1 |
---|
title | Using PlanSwift Object Model |
---|
linenumbers | true |
---|
|
|
Pascal Scripting (OLE)
Code Block |
---|
firstline | 1 |
---|
title | Item Object Model |
---|
linenumbers | true |
---|
|
|
Code Block |
---|
title | Root Object Model |
---|
linenumbers | true |
---|
|
|
Pascal Scripting
Code Block |
---|
firstline | 1 |
---|
title | Item Object Model |
---|
linenumbers | true |
---|
|
|
Code Block |
---|
title | Using the PlanSwift Object Model |
---|
linenumbers | true |
---|
|
|