Jump to content

How to add a folder to build spec using VI scripting


Gribo

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

Link to comment

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.

Link to comment
  • 2 months later...
  • 1 year later...

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
Link to comment
  • 4 weeks later...

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.

Link to comment
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

Link to comment
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
Link to comment

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.