Versions Compared

Key

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

DrawTwoWayLayout


...

Function used to perform segment layouts (in 2 directions) at a specified span, horizontal run, as well as spacing.

...


Syntax:

Procedure: DrawTwoWayLayout(aItem: string; oSpanPnt1X; oSpanPnt1Y, oSpanPnt2X, oSpanPnt2Y, oRunPnt1X , oRunPnt1Y, oRunPnt2X , oRunPnt2Y: double; bIncludeFirst, bIncludeLast: boolean; nSpacing: double; aAreaSection: string): boolean;

Arguments: 
AItem: String
Specifies the area section to assign the layout segments to.

SpanLineX and SpanLineY: Double
Direction span start and endpoint.

RunLineX and RunLineY: Double
Horizontal (side to side) run direction of area to of area to populate. Requires a start and endpoint;

bIncludeFirst: Boolean
Specifies whether to include a segment at the "start" run point. Even if it does not fall within the spacing range.

bIncludeLast: Boolean
Specifies whether to include a segment at the "last" run point. Even if it does not fall within the spacing range.

nSpacing: Double
Specifies the "run" spacing used when laying out segment objects.

AArea: String (optional parameter)
Specifies a defined "Area Segment" to trim/extend laid segments tosegments to. Supply either the path or GUID to the area section. Or, empty double-quotes for no quotes for no trim/extending required.

Syntax:

Procedure: DrawTwoWayLayout(aItem: string; oSpanPnt1X; oSpanPnt1Y, oSpanPnt2X, oSpanPnt2Y, oRunPnt1X , oRunPnt1Y, oRunPnt2X , oRunPnt2Y: double; bIncludeFirst, bIncludeLast: boolean; nSpacing: double; aAreaSection: string): boolean;

API Call:

...


...

API Call:

Code Block
languagedelphi
titleScripting
linenumberstrue
collapsetrue
var
  bIncludeFirst : boolean;
  bIncludeLast  : boolean;
  nSpacing      : double;
  oSpanPnt1X    : double;
  oSpanPnt1Y    : double;
  oSpanPnt2X    : double;
  oSpanPnt2Y    : double;
  oRunPnt1X     : double;
  oRunPnt1Y     : double;
  oRunPnt2X     : double;
  oRunPnt2Y     : double;
  aItem         : string;
  aAreaSection  : string;
begin
  aItem := NewItem('\Job\Takeoff', 'Segment', 'Name');

  //////////////////////////////////////////////////////////////////////////////
  // SPAN...                                                                  //
  //////////////////////////////////////////////////////////////////////////////
  oSpanPnt1X := 0;
  oSpanPnt1Y := 0;
  oSpanPnt2X := 0;
  oSpanPnt2Y := 0;
  if GetLine(oSpanPnt1X, oSpanPnt1Y, oSpanPnt2X, oSpanPnt2Y, 'Select Span') = 0 then
    begin
      Exit;
    end;

  //////////////////////////////////////////////////////////////////////////////
  // RUN...                                                                   //
  //////////////////////////////////////////////////////////////////////////////
  oRunPnt1X := 0;
  oRunPnt1Y := 0;
  oRunPnt2X := 0;
  oRunPnt2Y := 0;
  if GetLine(oRunPnt1X, oRunPnt1Y, oRunPnt2X, oRunPnt2Y, 'Select Run') = 0 then
    begin
      Exit;
    end;

  // place or ignore segment at run "start" point...
  bIncludeFirst := FALSE; // (T/F)...

  // place or ignore segment at run "end" point...
  bIncludeLast := FALSE; // (T/F)...

  // spacing (inches) used when creating segments...
  nSpacing := 24; // 12, 16, 24...

  // (optional) either create or select a area section to trim or extend to...
  aAreaSection := SelectedItem();

  // Function that lays the sticks (2 ways)...
  DrawTwoWayLayout(aItem,
                   oSpanPnt1X,    oSpanPnt1Y,
                   oSpanPnt2X,    oSpanPnt2Y,
                   oRunPnt1X ,    oRunPnt1Y,
                   oRunPnt2X ,    oRunPnt2Y,
                   bIncludeFirst, bIncludeLast,
                   nSpacing,
                   aAreaSection);
end;