VS:GetDashDataValPairAt: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
(add remark)
(correct units)
Line 50: Line 50:
* 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 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 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).
* The REAL values returned are page inches.
</remark>
</remark>



Revision as of 06:47, 4 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 page inches.

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]]