...
...
GetPropertyResultAsFloat
Attempts to return the given property value as a floating point value. If the calculated property value can not be converted, the value supplied by Default is returned.
...
Function
: GetPropertyResultAsFloat(ItemPath, PropertyName:
String
; Default:
Double
=
0
):
Double
;
Code Reference:
- 1. Navigate to Plugin Store->Tool Manager and create a new Plugin
- 2. Set the plugin type to Script Code and open the Editor
- 3. Copy Code into the editor
- 4. Press run
API
...
Calls
Delphi
Code Block |
---|
language | delphi |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using IItem Object Model |
---|
linenumbers | true |
---|
collapse | true |
---|
|
procedure TForm1.GetSetPoint(sender: TObject);
var
ps: IPlanSwift;
area,sect: IItem;
xs,cx,cy: Extended;
pgw,pgh,p1x,p1y,p2x,p2y,p3x,p3y,p4x,p4y: Extended;
begin
//Create the planswift interface
ps := coPlanswift.Create;
//Create a new Area Item
area := ps.GetItem('Job\Takeoff');
area := area.NewItem('Area','SetPointArea');
//Add a Section to the new Area
sect := area.NewSection('SetPoint Area Section');
//Get the page width and height
pgw := ps.GetPropertyResultAsInteger(ps.Selectedpage.guid,'PageWidth',0);
pgh := ps.GetPropertyResultAsInteger(ps.SelectedPage.guid,'PageHeight',0);
//Get the scale of the page... needed to draw area to scale
xs := ps.GetPropertyResultAsFloat(ps.SelectedPage.guid,'ScaleX',0);
//Get the Center X and Y pos of the page
cx := pgw /2;
cy := pgh /2;
//Set First point of area of Square
p1x := cx - 20 * xs;
p1y := cy - 10 * xs;
sect.NewPoint(p1x,p1y);
// Add Second Point
p2x := cx + 10 * XS;
p2y := p1y;
sect.NewPoint(p2x,p2y);
//Add Third Point
p3x := p2x;
p3y := cy + 10 * xs;
sect.NewPoint(p3x,p3y);
//Add Fourth Point
p4x := cx - 10 * xs;
p4y := p3y;
sect.NewPoint(p4x,p4y);
//Show Message to fix first point to create a true square box
ShowMessage('Now will fix the first point by using set point');
//Set the proper position of the first point
p1x := cx - 10 * XS;
// pass that point to planswift using setpoint
ps.SetPoint(sect.guid,0,p1x,p1y);
//Free Planswift
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 |
---|
|
|