Jump to content
Developer Wiki and Function Reference Links ×

Add Tool to Workspace


DomC

Recommended Posts

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 by DomC
Link to comment
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

  • Like 1
Link to comment

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...