DomC Posted April 24, 2022 Share Posted April 24, 2022 Hi I just stumpled over that here:https://developer.vectorworks.net/index.php/VS:CallTool It seems, that CallTool is able to server a callback function. It is satisfying great to see every step of better python interaction with Vectorworks. Unfortunately it seems, that the example code on the developer Wiki does not work here. Anybody tried something already which is using that callback feature? Quote Link to comment
DomC Posted April 24, 2022 Author Share Posted April 24, 2022 That little test works here. It seems the nested callback of the wiki-example is a little bit too ambitious. vs.DSelectAll() def resultCallback1(): h1 = vs.FSActLayer() vs.DSelectAll() p1 = vs.GetSegPt1(h1) p2 = vs.GetSegPt2(h1) vs.Locus(p1) vs.Locus(p2) vs.CallTool(-201, resultCallback1) Quote Link to comment
Letti R Posted April 28, 2022 Share Posted April 28, 2022 Hello, i tried to use this in a tool. Unfortunately i found this function to be inconsistent at least when used in a tool that is called by a click. After i selected the tool, sometimes the first click on the drawing (i assume this is the click that runs the code) is the first point of the line, and sometimes i need another click on the drawing to start the line. In your example this is not too bad, because the vs.CallTool() function is called right at the start of the script. But i wanted the first click on the drawing to just open an UI and than call the vs.CallTool() according to the mode that had been chosen in the UI. I also tried to call the vs.CallTool() function two times in a row, but i always crashed vectorworks. 1 Quote Link to comment
MBench Posted January 18, 2024 Share Posted January 18, 2024 @Letti R, My vectorworks crashes every time I try to run it as well! 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.