The Hamma Posted January 12 Share Posted January 12 (edited) Looking at the Vectorscript reference it appears that SetToByName does not support internal tools and some of the "internal tools" do not have and index. Is there any way to set the current tool using a script to those "internal tools" that do not have an index? Tools that are internal without indexes are but not limited to: "Door Tool" "Window Tool" "Slab Tool" "Wall End Cap Tool" @Pat Stanford@Jesse Cogswell@MullinRJ Edited January 15 by The Hamma Quote Link to comment
Pat Stanford Posted January 12 Share Posted January 12 I think that comment is from when the command was originally added to the program in 2014. Not sure if it still applies. Quote Link to comment
Pat Stanford Posted January 12 Share Posted January 12 I just tested and B1:=CallToolByName('Door Tool'); B1:=CallToolByName('Door Tool'); works. I have not tested the others. Quote Link to comment
SamIWas Posted January 13 Share Posted January 13 (edited) 5 hours ago, Pat Stanford said: I just tested and B1:=CallToolByName('Door Tool'); B1:=CallToolByName('Door Tool'); works. I have not tested the others. Any idea what would cause this to work on some of my custom tools, but with others, it flashes the tool in the pallete real quick then returns to the selection tool? I was getting excited to write my own shortcut selector for my StreamDeck since the native shortcut system is almost full. But I can't do it if it won't actually select the tools. Edited January 13 by SamIWas Quote Link to comment
Pat Stanford Posted January 13 Share Posted January 13 Try the SetTool commands instead of CallTool. CallTool is really only supposed to set the tool temporarily inside the script and then revert when the script ends. SetTool is the one to use when you want to change the tool "permanently." Quote Link to comment
Pat Stanford Posted January 13 Share Posted January 13 Or if you were already using SetTool then try the CallTool version. Maybe I have the descriptions backwards. Quote Link to comment
The Hamma Posted January 15 Author Share Posted January 15 (edited) On 1/12/2024 at 7:58 PM, SamIWas said: I was getting excited to write my own shortcut selector for my StreamDeck since the native shortcut system is almost full. But I can't do it if it won't actually select the tools. This is actually what I’m working on. I have written two, scripts that I use to call the functions from stream deck with a shortcut. It calls the script and then has user input for the tool name. This is where I have stream deck, enter the name of the tool. Or the index. Which then is executed by the script. my scripts are attached. I am using control+shift+alt+X for the tool shortcut And control+shift+alt+Z for the menu shortcut If I ever finish my stream deck profile, I will upload it PROCEDURE StreamDeckCommand; {Input the command name with the index at the end of the name. Use two digits for the index name. ie. for 1 use 01 for 0 use 00. Print command would be "Print00", Font Size 4 command would be "Font Size01" and Font size 144 would be "Font Size17"} VAR SDstring,SDStrInt:STRING; SDLen,SDInt:INTEGER; BEGIN SDstring:=StrDialog('Command to run',''); SDLen:=Len(SDstring); SDStrInt:=Copy(SDstring,SDLen-1,2); SDInt:=Str2Num(SDStrInt); SDstring:=Copy(SDString,1,SDLen-2); if SDstring <> '' THEN DoMenuTextByName(SDstring,SDInt); END; RUN(StreamDeckCommand); PROCEDURE StreamDeckTool; {Either input the tool name or the tool index} VAR Istool,SDstring:STRING; Result:BOOLEAN; BEGIN SDstring:=StrDialog('Command to run',''); Istool:=Copy(SDstring,1,1); if SDstring <> '' THEN BEGIN IF Istool = '-' THEN Result:=SetToolbyIndex(Str2Num(SDstring)) ELSE Result:=SetToolByName(SDstring); END; END; RUN(StreamDeckTool); StreamDeckTool.vsm StreamDeckCommand.vsm Edited January 15 by The Hamma Quote Link to comment
The Hamma Posted January 15 Author Share Posted January 15 On 1/12/2024 at 2:49 PM, Pat Stanford said: B1:=CallToolByName('Door Tool'); B1:=CallToolByName('Door Tool'); works. Ok I was wrong about "Window Tool" and "Door Tool" being internal commands, but the other two "Slab Tool" and "Wall End Cap Tool" do not have pugins and can't be called. Quote Link to comment
SamIWas Posted January 17 Share Posted January 17 On 1/14/2024 at 8:21 PM, The Hamma said: This is actually what I’m working on. I have written two, scripts that I use to call the functions from stream deck with a shortcut. It calls the script and then has user input for the tool name. This is where I have stream deck, enter the name of the tool. Or the index. Which then is executed by the script. my scripts are attached. I am using control+shift+alt+X for the tool shortcut And control+shift+alt+Z for the menu shortcut If I ever finish my stream deck profile, I will upload it PROCEDURE StreamDeckCommand; {Input the command name with the index at the end of the name. Use two digits for the index name. ie. for 1 use 01 for 0 use 00. Print command would be "Print00", Font Size 4 command would be "Font Size01" and Font size 144 would be "Font Size17"} VAR SDstring,SDStrInt:STRING; SDLen,SDInt:INTEGER; BEGIN SDstring:=StrDialog('Command to run',''); SDLen:=Len(SDstring); SDStrInt:=Copy(SDstring,SDLen-1,2); SDInt:=Str2Num(SDStrInt); SDstring:=Copy(SDString,1,SDLen-2); if SDstring <> '' THEN DoMenuTextByName(SDstring,SDInt); END; RUN(StreamDeckCommand); PROCEDURE StreamDeckTool; {Either input the tool name or the tool index} VAR Istool,SDstring:STRING; Result:BOOLEAN; BEGIN SDstring:=StrDialog('Command to run',''); Istool:=Copy(SDstring,1,1); if SDstring <> '' THEN BEGIN IF Istool = '-' THEN Result:=SetToolbyIndex(Str2Num(SDstring)) ELSE Result:=SetToolByName(SDstring); END; END; RUN(StreamDeckTool); StreamDeckTool.vsm 5.7 kB · 0 downloads StreamDeckCommand.vsm 5.91 kB · 0 downloads Just after I posted, I found SetToolByName or whatever and got it started. But I'll look at yours, too. Quote Link to comment
MullinRJ Posted January 17 Share Posted January 17 On 1/14/2024 at 7:43 PM, The Hamma said: Ok I was wrong about "Window Tool" and "Door Tool" being internal commands, but the other two "Slab Tool" and "Wall End Cap Tool" do not have pugins and can't be called. Hello David, I found constants for the Slab Tool (-248) and the Wall End Cap Tool (-355). I did not find constants for the Door or Window tools, but those two can be called with CallToolByName() or SetToolByName(), as Pat mentioned. Raymond Quote Link to comment
The Hamma Posted January 17 Author Share Posted January 17 Thank you. 1 hour ago, MullinRJ said: Hello David, I found constants for the Slab Tool (-248) and the Wall End Cap Tool (-355). I did not find constants for the Door or Window tools, but those two can be called with CallToolByName() or SetToolByName(), as Pat mentioned. Quote Link to comment
The Hamma Posted January 23 Author Share Posted January 23 Link to the my stream deck profile that I posted. 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.