livespace josha Posted December 5, 2022 Share Posted December 5, 2022 Is there a way to map OIP drop-down menu item options to a shortcut key(s)? Specific use: In ConnectCAD, the "Circuit Type" has 4 options. I use "Polyline" and "Arrow" 99% of the time. Rather than have to go to the OIP every time, a hotkey would be faster. And I'd probably map it to my Streamdeck too. Tagging @Conrad Preen too, maybe he has a thought? Quote Link to comment
Pat Stanford Posted December 5, 2022 Share Posted December 5, 2022 A script to set the field value the way you want it could be made into a Plugin Menu Command and then given a keyboard shortcut. Quote Link to comment
livespace josha Posted December 6, 2022 Author Share Posted December 6, 2022 Thanks @Pat Stanford. I meant to put in my original post that I'm not a plug-in or coding master... Any chance you can share a resource to get me started. Quote Link to comment
Pat Stanford Posted December 6, 2022 Share Posted December 6, 2022 And I didn't post a full answer because I am not a ConnectCAD master. 😉😂 Post a simple file with an object (or objects if different types) showing the field in the OIP that you are trying to control and I will see what I can do. 1 Quote Link to comment
livespace josha Posted December 9, 2022 Author Share Posted December 9, 2022 Here ya' go! Does this represent it well engough? simple CC circuit.vwx Quote Link to comment
Pat Stanford Posted December 9, 2022 Share Posted December 9, 2022 The scriptbelow seems to do what you want. In line 12 change the 'Polyline' to 'Arrow' to get the other version. Take a look at this thread about how to make it into a Menu Command and add that command to a workspace and give it a keyboard shortcut. Procedure SetCircuitType; {December 9, 2022} {©2022 Patrick Stanford pat@coviana.com} {Licensed under the GNU Lesser General Public License} {No Warranty Expressed or Implied. Use at your own risk.} VAR H1 :Handle; Procedure Execute(Hd1:Handle); BEGIN SetRField(Hd1,'Circuit','CircuitType','Polyline'); ResetObject(Hd1); ResetObject(Hd1); End; BEGIN ForEachObject(Execute,(((PON='Circuit') & (SEL=TRUE)))); End; Run(SetCircuitType); Quote Link to comment
livespace josha Posted December 12, 2022 Author Share Posted December 12, 2022 Thanks @Pat Stanford. Something was odd when I first tried it, but I was not able to recreate the issue after a reboot. This will be a huge time-saver. Quote Link to comment
livespace josha Posted December 30, 2022 Author Share Posted December 30, 2022 Hey @Pat Stanford I was able to re-create the oddity I experienced. If you toggle from polyline to arrow using the OIP, all works as expected. However, when using the script, the source and destination arrows appear differently. They don't appear as short arrows, and sometimes they are oddly aligned. Screen grab and file attached. Top is OIP, bottom is script. Arrow to polyline works as expected using either your script or the OIP. simple CC circuit.vwx 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.