DomC Posted April 27, 2023 Share Posted April 27, 2023 (edited) Hello So far it works implementing a Tool in the Workspace and Creating a new Palette Group. So far it works for path Objects or Point Objects (vso). Event Enabled or not Event Enablet. But I can't get it to work with a VST. I tested with this tool "Blindfront" This one here: As soon as I manually drag it into the workspace the tool works. and also after that the tool i added with the script works. So far the workspace itself looks identical if i drag manually the tool in the workspace as if i create the tool by script. I think I am missing some important parameter here. The Tools is placed into the palette and is shown ad expected but not the tool can't be selected. Anybody can help? Here My small test: #Get Group Palette by Index 1 (0 is Construction palette) pName = vs.ws2GetToolAt("", 1) result, outDisplayName, outShortcutKey, outShortcutKeyModifier, outResourceID = vs.ws2GetToolInfo(pName) vs.AlrtDialog('Put Tool in ' + outDisplayName) #The .vst is already in the Plug-Ins Folder # id of group palette tsPath = pName #outDisplayName#GetPalettePath('Werkzeuggruppen') tsName = 'NewPalette' tsNameUniversal = tsName #can be a uuid or just here for Testing 'NewPalette' vs.ws2CreateToolSet(tsPath, tsNameUniversal, tsName, '') path_new_tool = '/'.join([tsPath, tsNameUniversal]) # Add tools ok = vs.ws2CreateTool(path_new_tool, "Blindfold", 3) #Don't know what this index 3 is used for #vs.ws2GetToolInfo(toolPath) vs.ws2CommitChanges(False, False) bWorked = vs.wsEditEnd(False) Edited April 27, 2023 by DomC Quote Link to comment
JBenghiat Posted April 27, 2023 Share Posted April 27, 2023 34 minutes ago, DomC said: ok = vs.ws2CreateTool(path_new_tool, "Blindfold", 3) #Don't know what this index 3 is used for I believe this is the problem. Here are the constant values I have noted: kSDKTool = 1 kVectorScriptTool = 2 kVectorScriptObject = 3 kSDKParametric = 4 1 Quote Link to comment
DomC Posted April 27, 2023 Author Share Posted April 27, 2023 Wow You are my Hero. Thank you so much! Tool Type index 2 was the right joice. Quote Link to comment
Pat Stanford Posted April 27, 2023 Share Posted April 27, 2023 Take a look at the developer help for wsAddTool. https://developer.vectorworks.net/index.php/VS:wsEditAddTool Tool Type Constant Regular External Tool 1 VectorScript Tool (.vst) 2 VectorScript Object (.vso) 3 Custom Parametric 4 Note: The Custom Parametric tool type includes SDK objects of type Point, Line, Box, 2D Path, and 3D Path. 1 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.