Thomas_ Posted April 9, 2022 Share Posted April 9, 2022 Ok this is possibly a more generic Vectorworks question, but the use point for me is strictly related to connectcad. Is there a way to take, for instance the socket tool, and replicate it, but with specific values already filled in? For instance to identify a line level audio XLR input on the left hand side of the equipment. That way I could create a tool palette of the most used connectors to build devices with quickly, with a single click instead of 5 clicks and three typed in fields (Exaggerating only slightly honestly). In my systems 90+% of connectors, if not 95% or 99% are really just a handful of configurations that I would like to reuse repeatedly and quickly to build equipment items. 1 Quote Link to comment
Vectorworks, Inc Employee Conrad Preen Posted April 11, 2022 Vectorworks, Inc Employee Share Posted April 11, 2022 Hi @Thomas_ as I replied in another thread this idea is definitely on our list. Quote Link to comment
Thomas_ Posted April 12, 2022 Author Share Posted April 12, 2022 Heh sorry I forgot I had mentioned this in the other thread, will carry my response here. Reply to your post from other thread about this: In the meantime, I have been diving into the Python docs to try to find a way to implement this via python, any pointers on where to start (For instance I was expecting a function call to activate a tool, and be able to define parameters of it, but haven't found anything for Connectcad tools (Sockets, etc.) yet)? Quote Link to comment
Vectorworks, Inc Employee Nikolay Zhelyazkov Posted April 13, 2022 Vectorworks, Inc Employee Share Posted April 13, 2022 Hello @Thomas_, You can use SetToolByName('SocketTool'); to activate the socket tool, but I am not really sure if you can set the tool modes from script. Best Regards, Nikolay Zhelyazkov Quote Link to comment
Vectorworks, Inc Employee Conrad Preen Posted April 13, 2022 Vectorworks, Inc Employee Share Posted April 13, 2022 @Thomas_ If you want to get active in scripting for ConnectCAD we will help support you. Conrad Quote Link to comment
Thomas_ Posted April 13, 2022 Author Share Posted April 13, 2022 I am definitely looking into it. It is just a matter of how much free time I have to really jump in, considering that along with my consulting business I am also a production manager for a fairly large road house now as well, time tends to be minimal, but there are enough things like this that would make a significant difference in my workflow that it is worth that time. My background includes programming in C/C++ and Python in the past as needed so obviously Python scripting peaks my interest at least. 5 hours ago, Nikolay Zhelyazkov said: You can use SetToolByName('SocketTool'); to activate the socket tool, but I am not really sure if you can set the tool modes from script. Thanks, I will dig into the function definition documentation in the next day or two then and see what I can find. Quote Link to comment
Thomas_ Posted June 6, 2022 Author Share Posted June 6, 2022 (edited) So finally had a moment to look at this while a show is loading out. These is a SetToolwithMode function that seems like it might be related (But maybe not exactly what I want), but I can't tell how to determine the INDEX of the SocketTool (Or the groups, etc. but will get to that after I get the selection working). I did test SetToolWithIndex('SocketTool') and despite returning '1' (aka TRUE) as the bool, it definitely did not select the tool, and I suspect this is a bug that might need to be looked at at some point (The fact it returns TRUE even if it can't actually select the tool that is). SetToolWithName('SocketTool') obviously does work, but SetToolWithMode requires an Index, and I just can't figure out how to determine the index of the ConnectCad tools as they are not listed in the appendix with the rest of the tools. EDIT: I have been trying to utilize vs.ws2 functions to try to get the tool index, but am having problems with tool paths. Based off my reading of the API, I would be able to, for instance: vs.Message(vs.ws2GetToolsCnt('Tool Sets/Schematics')) But that returns 0 which should be the count of tools in that tool set, so obviously I am doing something wrong there. Any hints? If I can understand how to correctly address the tool path, I should (at least in my head) be able to then utilize vs.ws2FindToolIndex() to find the index (Assuming I can figure out what is meant by 'Universal Name' in that function. That in turn would give me the indexes I might be able to pass to the SetToolWithMode command supposedly? Edited June 6, 2022 by Thomas_ More Information Quote Link to comment
Vectorworks, Inc Employee Nikolay Zhelyazkov Posted June 6, 2022 Vectorworks, Inc Employee Share Posted June 6, 2022 Hello @Thomas_, Not really sure that the ConnectCAD tools (and other tools in different toolsets) have unique tool IDs that can be used to call them with Tool ID. I am afraid that the tool IDs are useful only for basic tools, such as Selection, Text, etc. FYI - we are also working in the direction for making tool presets based on the discussions here, so if you do not succeed in achieving this with script, we might be able to provide you with another solution in the future. Best Regards, Nikolay Zhelyazkov Quote Link to comment
Thomas_ Posted June 6, 2022 Author Share Posted June 6, 2022 1 hour ago, Nikolay Zhelyazkov said: FYI - we are also working in the direction for making tool presets based on the discussions here, so if you do not succeed in achieving this with script, we might be able to provide you with another solution in the future. Thank you glad to hear it! This is still good knowledge for me to have though as I do want to learn my way through the vectorworks api to understand the scripting capabilities a bit more though. I would still encourage making everything available via API as much as possible for things, for instance right now I am working on setting up a streamdeck profile with my most commonly used tools, and finding the lack of bindings a bit troublesome for this, but if I could call from an API I might be able to create a single plugin that would allow me to use two key combination bindings (ala emacs, or qcad if you are familiar with that) to expand the available bindings, and allow me to more easily set up those shortcuts possibly by using multi-actions on the streamdeck to emulate the keybindings. All that being said, being able to click once to create a socket that is a Mic input with XLR-F connector on the left hand side (Or an array of them) would go a long way to helping to speed up creating new devices so I look forward to seeing that. 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.