VS:GetDashDataValPairAt: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision: vw2015)
(add remark)
Line 6: Line 6:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Function GetDashDataValPairAt gets the dash data for the specified dash style. The dash data is a dash/gap value pair. GetDashDataValPairAt returns false if the dash style or dash data doesn't exist. Dash styles support up to 5 dash/gap value pairs. </desc>
Function GetDashDataValPairAt gets the dash data for the specified dash style. The dash data is a dash/gap value pair. GetDashDataValPairAt returns false if the dash style or dash data doesn't exist. Dash styles support up to 5 dash/gap value pairs.</desc>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 46: Line 46:


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark></remark>
<remark>
[[User:Orso.b.schmid|Orso]], 2016.03.01:
* The dash style index required is relative to the dash style list, not the name list. Use [[VS:GetDashStyle]] or [[VS:GetDashStyleIndex]] to obtain it.
* The count of dash/gap pairs and the boolean value swt (if scale with thickness is ON) can be fetched with [[VS:GetNumDashDataPairs]].
* The REAL values returned are always points (1/72 of an inch).
</remark>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
Line 53: Line 58:
PROCEDURE Example;
PROCEDURE Example;
VAR
VAR
n, numPairs, dashIndex : INTEGER;
n, numPairs, dashIndex : INTEGER;
scaleWThick  :BOOLEAN;
scaleWThick  :BOOLEAN;
arrayDashDat : ARRAY[1..5] OF POINT;
arrayDashDat : ARRAY[1..5] OF POINT;
x,y : REAL;
x,y : REAL;


BEGIN
BEGIN
dashIndex := GetDashStyleIndex(TRUE, 2, 0.12, 0.18, 0.03, 0.07);
numPairs := GetNumDashDataPairs(dashIndex,scaleWThick);


dashIndex := GetDashStyleIndex(TRUE, 2, 0.12, 0.18, 0.03, 0.07);
FOR n := 1 TO numPairs DO BEGIN
 
  IF (GetDashDataValPairAt(dashIndex, n , x, y)) THEN BEGIN
numPairs := GetNumDashDataPairs(dashIndex,scaleWThick);
    arrayDashDat[n].x := x ;
 
    arrayDashDat[n].y := y ;
FOR n := 1 TO numPairs DO BEGIN
  END;  
IF (GetDashDataValPairAt(dashIndex, n , x, y)) THEN BEGIN
END;
  arrayDashDat[n].x := x ;
  arrayDashDat[n].y := y ;
END;  
END;
 
END;
END;
RUN(Example);</code>
RUN(Example);</code>

Revision as of 15:03, 1 March 2016

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

Function GetDashDataValPairAt gets the dash data for the specified dash style. The dash data is a dash/gap value pair. GetDashDataValPairAt returns false if the dash style or dash data doesn't exist. Dash styles support up to 5 dash/gap value pairs.

FUNCTION GetDashDataValPairAt(
dashStyleIndex :INTEGER;
dataIndex :INTEGER;
VAR dash :REAL;
VAR gap :REAL) : BOOLEAN;
def vs.GetDashDataValPairAt(dashStyleIndex, dataIndex):
    return (BOOLEAN, dash, gap)

Parameters

dashStyleIndex INTEGER The dash style index.
dataIndex INTEGER Index fo the data value pair.
dash REAL The dash segement value.
gap REAL The gap segment value.

Remarks

Orso, 2016.03.01:

  • The dash style index required is relative to the dash style list, not the name list. Use VS:GetDashStyle or VS:GetDashStyleIndex to obtain it.
  • The count of dash/gap pairs and the boolean value swt (if scale with thickness is ON) can be fetched with VS:GetNumDashDataPairs.
  • The REAL values returned are always points (1/72 of an inch).

Example

PROCEDURE Example;
VAR
 n, numPairs, dashIndex : INTEGER;
 scaleWThick  :BOOLEAN;
 arrayDashDat : ARRAY[1..5] OF POINT;
 x,y : REAL;

BEGIN
 dashIndex := GetDashStyleIndex(TRUE, 2, 0.12, 0.18, 0.03, 0.07);
 numPairs := GetNumDashDataPairs(dashIndex,scaleWThick);

 FOR n := 1 TO numPairs DO BEGIN
  IF (GetDashDataValPairAt(dashIndex, n , x, y)) THEN BEGIN
    arrayDashDat[n].x := x ;
    arrayDashDat[n].y := y ;
  END; 
 END;
END;
RUN(Example);

Version

Availability: from Vectorworks 2015

See Also

VS Functions:

VS:GetNumDashDataPairs | VS:GetDashStyleIndex

VS Functions:

[[VS:GetNumDashDataPairs]]

| [[VS:GetDashStyleIndex]]