Jump to content
Gribo

How to add a folder to build spec using VI scripting

Recommended Posts

Hello, 

I am trying to automate some code generation using a project template. The template also has build specification. I want to add an auto-populating folder to the build specification, but I can't get it to work. I am using the AB_API_SDIST class. If the folder exists in the template, I get an error 'Can't add the container to build specification'. If the folder does not exist in the template, I get a 1055 error code. 

How can I make it work?

 

Add files to project.png

Share this post


Link to post
Share on other sites

So are you trying to add a virtual folder under the Build Specifications section of a project?

I've never seen a virtual folder there and I can't seem to add one manually in a LabVIEW project or even drag an existing, empty, virtual folder into build specifications. If LabVIEW is throwing an error that you 'Can't add the container to build specification' I'm guessing it's just not something you can do. I'm also not sure why there would be an auto-populating folder under the build specifications because the build specifications don't have files associated with them.

Share this post


Link to post
Share on other sites

No, I am trying to add a standard folder to the 'Always included files' list. It is possible to add a folder to the 'Always included' list manually,  so I should be able to do it via the API.

Share this post


Link to post
Share on other sites

Below are screen shots of the operation I am trying to automate. I am using LV2014

 

 

Build spec step 1.png

Build spec step 2.png

Share this post


Link to post
Share on other sites

@Gribo Did you ever figure this out? I am trying to do the same thing

Share this post


Link to post
Share on other sites

No, I have manually created a template build specification which includes the folders that I want, then I copy it. 

Edited by Gribo

Share this post


Link to post
Share on other sites

Ok, thank you

Virtual folders are proving to quite a bit of trouble, simply deleting one from the project can result in labview 2017 crashing (only on Windows 10 it seems)

Edit: and in Windows 7 as well, just seems less likely to happen

Edited by BramJ

Share this post


Link to post
Share on other sites

I was trying to script something involving a build specification just yesterday. I'm pretty sure "Targets" refers to things like "My Computer", not build specifications. You can get a reference to the Build Specifications folder through the "My Computer" property of the project, IIRC. And from there you can get the Owned Items[] property, find the one you need, and use "To More Specific Class" to make it a Build Specification refnum. However, strangely, I haven't found any methods/properties that do anything specific to build specifications. Maybe I'm looking in the wrong place though.

Share this post


Link to post
Share on other sites
2 hours ago, flarn2006 said:

However, strangely, I haven't found any methods/properties that do anything specific to build specifications. Maybe I'm looking in the wrong place though.

Yeah, I'm not aware of any. The App Builder API (vi.lib\AppBuilder\AB_API) provides most of the functionality you would need to programmatically modify build specs. I talk about it briefly in my Hidden Gems presentation: http://www.ni.com/hiddengems

Share this post


Link to post
Share on other sites
42 minutes ago, Darren said:

Yeah, I'm not aware of any. The App Builder API (vi.lib\AppBuilder\AB_API) provides most of the functionality you would need to programmatically modify build specs. I talk about it briefly in my Hidden Gems presentation: http://www.ni.com/hiddengems

Taco deli? 😉

Edited by flarn2006
  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.