From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

project template root default path

I am creating a project template and want to set the default path for "Project Root".  It currently defaults to the users .\Documents\LabVIEW Data\. I would like to change this for my template or for all templates.

 

The white paper does not show a XML tag for setting this.  The only tags specified are for the source of the template. http://www.ni.com/white-paper/14045/en/

 

Is there a collection of advanced information on using custom project templates?

0 Kudos
Message 1 of 6
(2,951 Views)

Your custom project template project can reside anywhere.  Metadata.xml can exist in LabVIEW Data or <LabVIEW [vers]>\ProjectTemplates\

 

Metadata.xml can contain an optional path to your template.lvproj  as the relative path from LocationtPath directory tag (Which is itself relative to  ProjectTemplates\Source\

 

In short, you cannot "Globaly" move all template projects but, you CAN edit "Metadata.xml" to list only those projects you want to list.

 

Now you ask why.... Because, many toolkits and addons do or will contain project templates-  their installers need a defined location to metadata.xml to install and play nice.  Changing this behavior for your systems will result in pain when you want to bring in outside tools.  Don't do it!  Conform to the established deployment pattern-  If NI choses to change it in the future, compatability is their problem. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 6
(2,929 Views)

I may have not been clear in my question.  I want to essentially customize page 2 of the Create Project only for my template.  I want to create an interface that ask the user of the template for input that will create the name of the project and then create the project in a specific location (other than the \LabVIEW Data\ directory)

 

I looked at doing my CustomVIMode AfterPage1 but this gives no reference to the created object. I used the create Blank Project as an example.

 

I have also been playing with AfterPage2, both WithUI and NoUI. 

 

I have added my template to the \ProjectTemplates\MetaData\ xml file.  The <LocationPath> and <ProjectPath> allow you to select the source for the template, but not the destination of the newly created project.  Unless there is another xml tag that I don’t know about.

 

I’ve noticed that the Create project tool remembers that last location a project was created.  There has to be a way to set this. I just found it in the LabVIEW.ini file: NewProjectSpecPagePath="C:\Users\....”  Now I need to figure out how to set this for my template.

 

I still need to figure out how to allow a custom vi to help the user create the project name.

Message 3 of 6
(2,921 Views)

@jeff.kittle wrote:

I may have not been clear in my question.  I want to essentially customize page 2 of the Create Project only for my template.  I want to create an interface that ask the user of the template for input that will create the name of the project and then create the project in a specific location (other than the \LabVIEW Data\ directory)

 

I looked at doing my CustomVIMode AfterPage1 but this gives no reference to the created object. I used the create Blank Project as an example.

 

I have also been playing with AfterPage2, both WithUI and NoUI. 

 

I have added my template to the \ProjectTemplates\MetaData\ xml file.  The <LocationPath> and <ProjectPath> allow you to select the source for the template, but not the destination of the newly created project.  Unless there is another xml tag that I don’t know about.

 

I’ve noticed that the Create project tool remembers that last location a project was created.  There has to be a way to set this. I just found it in the LabVIEW.ini file: NewProjectSpecPagePath="C:\Users\....”  Now I need to figure out how to set this for my template.

 

I still need to figure out how to allow a custom vi to help the user create the project name.


OK Then, you are as advanced as I can help you with on Project templates.  A chat with Simon or Darren is is order-  Open a SR ticket and get the answers.  Project Templates really are new enough that a lot of the subtlties are not readilly apparent.  Do share what you learn!


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 6
(2,912 Views)

Here is the code to set the INI Token which controls the location of a newly created project from a template.

 

NewProjectSpecPagePath.png

0 Kudos
Message 5 of 6
(2,749 Views)

From what I can gather, you want a custom 2nd page (called a 'SpecPage' in the software) in the Create Project dialog for your template. The Actor Framework template implements one of these, as do some other products.If you're in LabVIEW 2013 or later, there is a SpecPage template that you can start from here:

 

resource\dialog\NewProjectWizard\SpecPage_Templates\SpecPage_Standard.vit

 

I recommend starting with this template and referencing the structure of the Actor Framework template (which includes a child class of MetaDataObj.lvclass that allows the template to call a custom SpecPage). Let me know if you have any further questions.

0 Kudos
Message 6 of 6
(2,744 Views)