JDave Posted September 15, 2007 Report Share Posted September 15, 2007 Does anyone know how to programmatically open a blank VI? The menubar will be hidden, so I can't use the menu shortcut. The hook VI lv_new_vi.vi doesn't exist to call. I didn't notice an Application invoke node method. But there must be some other way. (Probably as easy as Ctrl+N ). David Quote Link to comment
David Boyd Posted September 15, 2007 Report Share Posted September 15, 2007 QUOTE(dsaunders @ Sep 14 2007, 12:48 PM) Does anyone know how to programmatically open a blank VI? The menubar will be hidden, so I can't use the menu shortcut. The hook VI lv_new_vi.vi doesn't exist to call. I didn't notice an Application invoke node method. But there must be some other way. (Probably as easy as Ctrl+N ). David There's an application scripting method 'New LabVIEW Document' which takes a numeric parameter and creates any one of the following: standard VI, global, control, polyVI, runtime menu, project, plus some templates of these types (I didn't try an exhaustive set of values). Unfortunately, it doesn't return a refnum to the created object.I'm pretty sure there was also a 'New VI' primitive which created a new VI with various options for what kind, and returned a refnum for the created object. But it no longer appears in my Application Control palette. Must need a ReallySuperSecret... token (or legendary scripting license activation) to get to it now Since none of this works in runtime, you were, of course, referring to creating a new VI while running the development environment, right? Why is the menubar of the calling VI necessarily hidden? Dave Quote Link to comment
JDave Posted September 15, 2007 Author Report Share Posted September 15, 2007 QUOTE(David Boyd @ Sep 14 2007, 01:42 PM) There's an application scripting method 'New LabVIEW Document' which takes a numeric parameter and creates any one of the following: standard VI, global, control, polyVI, runtime menu, project, plus some templates of these types (I didn't try an exhaustive set of values). Unfortunately, it doesn't return a refnum to the created object.I'm pretty sure there was also a 'New VI' primitive which created a new VI with various options for what kind, and returned a refnum for the created object. But it no longer appears in my Application Control palette. Must need a ReallySuperSecret... token (or legendary scripting license activation) to get to it now Since none of this works in runtime, you were, of course, referring to creating a new VI while running the development environment, right? Why is the menubar of the calling VI necessarily hidden? Dave Thanks, Dave. I should have put this in the scripting forum, apparently. Both those suggestions work great. Somehow I missed the Application Method. The 'New VI' primitive is still on the palette, at least the OpenG palette. I verified it still works in 8.2.1. As for the lack of menubar, I am creating a standalone toolbar. If all other VIs are shut down, the toolbar still stays up because it is a VI. I wanted the option to bring up a blank VI so the toolbar wouldn't be so lonely. Quote Link to comment
David Boyd Posted September 16, 2007 Report Share Posted September 16, 2007 QUOTE(dsaunders @ Sep 14 2007, 04:58 PM) As for the lack of menubar, I am creating a standalone toolbar. If all other VIs are shut down, the toolbar still stays up because it is a VI. I wanted the option to bring up a blank VI so the toolbar wouldn't be so lonely. Ah. For that, you may want the VI property 'Set Close If Lonely' to be set TRUE. This is a scripting property which must be set by the tool VI on itself each time it is invoked (it doesn't persist through a save on the tool VI). This is what allows the tool to be closed whenever LV detects that it's the last VI open. I used it on the Tunnel Wiring Wizard. Also, there are scripting properties to set a VI as a 'system' VI, which is a mod that does persist when the VI is saved. This is a VI flag that causes the tool VI to be invisible to the hierarchy window (I think it has other effects, but I can't recall). Also set on the TWW, at least my original version. Hope this helps. Best regards, Dave Quote Link to comment
Darren Posted September 16, 2007 Report Share Posted September 16, 2007 For posterity, an easy way to create a new VI is to just use Open VI Reference on an empty template VI. Then you can do Open FP, or whatever other operations you wish, with the new instance of the template VI you just created. -D 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.