VS:SetDashStyleN: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
(fix faulty example)
m (Transfer Orso to _c_)
 
(3 intermediate revisions by the same user not shown)
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Procedure SetDashStyleN creates a new linestyle in a Vectorworks document. Parameter name defines the name of the linestyle, parameter swt defines whether the linestyle will be scaled with thickness, and parameter numPairs specifies the number of length pairs defining the linestyle.<BR>
Procedure SetDashStyleN creates a new linestyle in a Vectorworks document. Parameter name defines the name of the linestyle, parameter swt defines whether the linestyle will be scaled with thickness, and parameter numPairs specifies the number of length pairs defining the linestyle.
<BR>
 
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.</desc>
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.</desc>


Line 68: Line 68:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<remark>
[[User:Orso.b.schmid|Orso]], 2014.04.08:  It creates a named dash style definition. The name will appear also in the name list.
[[User:CBM-c-|_c_]], (2014.04.08):  It creates a named dash style definition. This sets the name in both the name list and the (now) hidden dash style list. The parameter numPairs seems to be automatically filled depending on the count of pair values passed (you can omit pairs, if they are not needed). In the example below it works with "0" whereby you'd think that "2" would be needed, since two dash-gap pairs are passed. The routine supports up to 10 real dash-gap values (5 pairs). The values must be entered in page inches. More comments on Vectorlab's [http://www.vectorlab.info/index.php?title=Index_pitfalls Index_pitfalls].
 
The routine can be expressed as follows, whereby you'll only enter as many dashX-gapX values as needed:
<code lang="pas">SetDashStyleN(name: STRING; scalesWithThickness: BOOLEAN; numPairs: INTEGER; dash1, gap1, dash2, gap2, dash3, gap3, dash4, gap4, dash5, gap5: REAL);</code>
</remark>
</remark>


Line 74: Line 77:
<sample>
<sample>
<code lang="pas">
<code lang="pas">
SetDashStyle('My Dash Style', True, 1, 1", 1/4", 1/4", 1/4");
SetDashStyle('My Dash Style', True, 0, 1", 1/4", 1/4", 1/4");
</code>
</code>
</sample>
</sample>

Latest revision as of 06:49, 30 December 2020

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

Description

Procedure SetDashStyleN creates a new linestyle in a Vectorworks document. Parameter name defines the name of the linestyle, parameter swt defines whether the linestyle will be scaled with thickness, and parameter numPairs specifies the number of length pairs 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.

PROCEDURE SetDashStyleN(
name :STRING;
swt :BOOLEAN;
numPairs :INTEGER;
pair1 :REAL;
pair2 :REAL;
pair3 :REAL;
pair4 :REAL;
pair5 :REAL);
def vs.SetDashStyleN(name, swt, numPairs, pair1, pair2, pair3, pair4, pair5):
    return None

Parameters

name STRING
swt BOOLEAN
numPairs INTEGER
pair1 REAL
pair2 REAL
pair3 REAL
pair4 REAL
pair5 REAL

Remarks

_c_, (2014.04.08): It creates a named dash style definition. This sets the name in both the name list and the (now) hidden dash style list. The parameter numPairs seems to be automatically filled depending on the count of pair values passed (you can omit pairs, if they are not needed). In the example below it works with "0" whereby you'd think that "2" would be needed, since two dash-gap pairs are passed. The routine supports up to 10 real dash-gap values (5 pairs). The values must be entered in page inches. More comments on Vectorlab's Index_pitfalls.

The routine can be expressed as follows, whereby you'll only enter as many dashX-gapX values as needed:

SetDashStyleN(name: STRING; scalesWithThickness: BOOLEAN; numPairs: INTEGER; dash1, gap1, dash2, gap2, dash3, gap3, dash4, gap4, dash5, gap5: REAL);

Example

SetDashStyle('My Dash Style', True, 0, 1", 1/4", 1/4", 1/4");

Version

Availability: from Vectorworks 2010