VS:CallToolByName: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
(add examples and see also)
 
(2 intermediate revisions by the same user not shown)
Line 5: Line 5:
-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<desc>
<desc>
Similar to [[VS:CallTool]], but takes name rather than ID. Supports plug-in tools (but not yet internal tools).
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>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<return>
<remark></remark>
</return>


-----------------------------------------------------------------------------------------------------------
-----------------------------------------------------------------------------------------------------------
<remark>
<sample>


</remark>
==== 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 ====
<sample>
<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 All Versions
Availability: from Vectorworks 2014


This is drop-in function.
</version>
</version>
-----------------------------------------------------------------------------------------------------------
<seeAlso>
[[VS:CallTool]], [[VS:SetToolByName]]
</seeAlso>


</vwDoc>
</vwDoc>


[[Category:VS Function Reference|CallToolByName]]
[[Category:VS Function Reference|CallToolByName]]
[[Category:VS Function Reference:Command|CallToolByName]]
[[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]]