VS:GetDashStyle: Difference between revisions
m (1 revision) |
(add example and remark) |
||
Line 24: | Line 24: | ||
swt | swt | ||
BOOLEAN | BOOLEAN | ||
scales with thickness | |||
</line> | </line> | ||
Line 29: | Line 30: | ||
numPairs | numPairs | ||
INTEGER | INTEGER | ||
count of used pairs | |||
</line> | </line> | ||
Line 34: | Line 36: | ||
pair1 | pair1 | ||
REAL | REAL | ||
values in pt (1/72 inches) | |||
</line> | </line> | ||
Line 39: | Line 42: | ||
pair2 | pair2 | ||
REAL | REAL | ||
values in pt (1/72 inches) or empty | |||
</line> | </line> | ||
Line 44: | Line 48: | ||
pair3 | pair3 | ||
REAL | REAL | ||
values in pt (1/72 inches) or empty | |||
</line> | </line> | ||
Line 49: | Line 54: | ||
pair4 | pair4 | ||
REAL | REAL | ||
values in pt (1/72 inches) or empty | |||
</line> | </line> | ||
Line 54: | Line 60: | ||
pair5 | pair5 | ||
REAL | REAL | ||
values in pt (1/72 inches) or empty | |||
</line> | </line> | ||
Line 61: | Line 68: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
[[User:Orso.b.schmid|Orso]], 2016.03.01: The dash style index returned is relative to the dash style list, so it's not an index that can be used with [[VS:Index2Name]]. This routine seems to be exactly the same as [[VS:GetDashStyleIndex]]. | |||
<code lang="vs"> | |||
indx := GetDashStyle(swt, 2, 0.12, 0.03); | |||
{ returns the dash style index of 'ISO-02 Dashed' or creates a style in the document with these values } | |||
</code> | |||
Parameter swt defines whether the linestyle will be scaled with thickness, and parameter numPairs specifies the number of length pairs (2-10) defining the linestyle. | Parameter swt defines whether the linestyle will be scaled with thickness, and parameter numPairs specifies the number of length pairs (2-10) defining the linestyle. | ||
The linestyle is defined by up to five black/white length pairs, which are specified in parameters | The linestyle is defined by up to five black/white length pairs, which are specified in parameters pair1 through pair5. The minimum length of any given black or white parameter is 1 point, or 1/72 of an inch, and the line specification must be in pairs. | ||
The Function will also set the document default line style. | The Function will also set the document default line style. | ||
</remark> | </remark> | ||
Line 79: | Line 92: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: from | Availability: from MiniCAD 5.0 | ||
</version> | </version> |
Revision as of 13:50, 1 March 2016
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Function GetDashStyle searches for the pattern specified by the parameters. If it exists, then the linestyle index associated with the existing dash pattern is returned. If it does not exist, then it is added to the document and the linestyle index associated with the new dash pattern is returned. The current document default linestyle will be set to the index of the dash pattern.
FUNCTION GetDashStyle(
swt :BOOLEAN;
numPairs :INTEGER;
pair1 :REAL;
pair2 :REAL;
pair3 :REAL;
pair4 :REAL;
pair5 :REAL) : INTEGER;
def vs.GetDashStyle(swt, numPairs, pair1, pair2, pair3, pair4, pair5): return INTEGER
Parameters
swt BOOLEAN scales with thickness numPairs INTEGER count of used pairs pair1 REAL values in pt (1/72 inches) pair2 REAL values in pt (1/72 inches) or empty pair3 REAL values in pt (1/72 inches) or empty pair4 REAL values in pt (1/72 inches) or empty pair5 REAL values in pt (1/72 inches) or empty
Remarks
Orso, 2016.03.01: The dash style index returned is relative to the dash style list, so it's not an index that can be used with VS:Index2Name. This routine seems to be exactly the same as VS:GetDashStyleIndex.
indx := GetDashStyle(swt, 2, 0.12, 0.03); { returns the dash style index of 'ISO-02 Dashed' or creates a style in the document with these values }
Parameter swt defines whether the linestyle will be scaled with thickness, and parameter numPairs specifies the number of length pairs (2-10) defining the linestyle. The linestyle is defined by up to five black/white length pairs, which are specified in parameters pair1 through pair5. The minimum length of any given black or white parameter is 1 point, or 1/72 of an inch, and the line specification must be in pairs. The Function will also set the document default line style.
Example
VectorScript
currLS:=GetDashStyle;
Python
vs.GetDashStyle(True, 1, 1)
Version
Availability: from MiniCAD 5.0