...
- Create a New Forms Application
- Add a PlanSwift to the References (Planswift_Tlb)
- Add a button to the form
- Copy code below to the onclick event of the button
- Open PlanSwift and select a digitizer object
- Compile and run
API
...
Calls
Delphi
Code Block | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
var
Ps: IPlanSwift;
Takeoff, itm: IItem;
begin
Ps := Planswift;
// Get the Takeoff Folder
Takeoff := Ps.GetItem('\Job\Takeoff');
// Create new Item and Begin Recording
itm := Takeoff.NewItem('Linear', 'New Linear');
itm.DoRecord;
// Cancel the digitization before the user can stop it
Ps.CancelTool;
Ps := nil;
end; |
C#
Code Block | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||
public class PlanswiftApi
{
private PlanSwift Planswift { get; }
public PlanswiftApi()
{
Planswift = new PlanSwift();
}
public void CreateAndRecordItem(string type, string name)
{
var takeoff = Planswift.GetItem("\\Job\\Takeoff");
var item = takeoff.NewItem(type, name);
item.DoRecord();
}
public void TestCancelTool()
{
// Create the Item and Begin Digitizing
CreateAndRecordItem("Linear", "My Linear");
// Cancel the Digitizer before the user can stop recording
Planswift.CancelTool();
}
} |
Code Block | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
Coming soon |
VB/VBA (OLE)
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Coming soon |
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
Coming soon |