VS:CallToolByName: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
(add examples and see also) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
Similar to | Similar to CallTool, but takes name rather than ID. Supports plug-in tools (but not yet internal tools).</desc> | ||
</desc> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<def> | <def> | ||
<funcDef lang="vs"> | <funcDef lang="vs"> | ||
FUNCTION CallToolByName(toolName: STRING) : BOOLEAN; | FUNCTION CallToolByName(toolName:STRING) : BOOLEAN; | ||
</funcDef> | </funcDef> | ||
<funcDef lang="py"> | <funcDef lang="py"> | ||
Line 29: | Line 28: | ||
</lineList> | </lineList> | ||
</params> | </params> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
< | <remark></remark> | ||
</ | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
< | <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> | </sample> | ||
----------------------------------------------------------------------------------------------------------- | |||
<seeAlso> | |||
VS Functions: | |||
* [[VS:CallTool]] | |||
* [[VS:CallToolByIndex]] | |||
</seeAlso> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: from | Availability: from Vectorworks 2014 | ||
</version> | </version> | ||
</vwDoc> | </vwDoc> | ||
[[Category:VS Function Reference|CallToolByName]] | [[Category:VS Function Reference|CallToolByName]] | ||
[[Category:VS Function Reference: | [[Category:VS Function Reference:Utility|CallToolByName]] |
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]]