VS:CallToolByName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(add examples and see also) |
||
(One intermediate revision by one other user not shown) | |||
Line 33: | Line 33: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample></sample> | <sample> | ||
==== VectorScript ==== | |||
<code lang="pas"> | |||
Message( CallToolByName( 'Spiral' ) ); | |||
{ activates Spiral tool, returns true if successful | |||
Note: Spiral is not an internal tool | |||
if you try it for example with 'Wall' this will return an error, since it's an internal tool } | |||
</code> | |||
==== Python ==== | |||
<code lang="py"> | |||
vs.Message( vs.CallToolByIndex( 'Spiral' ) ) | |||
# activates Spiral tool, returns true if successful | |||
# Note: Spiral is not an internal tool | |||
# if you try it for example with 'Wall' this will return an error, since it's an internal tool | |||
</code> | |||
</sample> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<seeAlso></seeAlso> | <seeAlso> | ||
VS Functions: | |||
* [[VS:CallTool]] | |||
* [[VS:CallToolByIndex]] | |||
</seeAlso> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
Latest revision as of 05:25, 19 January 2022
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Similar to CallTool, but takes name rather than ID. Supports plug-in tools (but not yet internal tools).
FUNCTION CallToolByName(
toolName :STRING) : BOOLEAN;
def vs.CallToolByName(toolName): return BOOLEAN
Parameters
toolName STRING
Example
VectorScript
Message( CallToolByName( 'Spiral' ) ); { activates Spiral tool, returns true if successful Note: Spiral is not an internal tool if you try it for example with 'Wall' this will return an error, since it's an internal tool }
Python
vs.Message( vs.CallToolByIndex( 'Spiral' ) ) # activates Spiral tool, returns true if successful # Note: Spiral is not an internal tool # if you try it for example with 'Wall' this will return an error, since it's an internal tool
Version
Availability: from Vectorworks 2014
See Also
VS Functions:
VS Functions:
- [[VS:CallTool]]
- [[VS:CallToolByIndex]]