Musisback Posted June 26, 2013 Share Posted June 26, 2013 Hello, I use external resources in my PIO's. (texture's, records format & symbols) To make the PIO's works better, I only import them when they are missing from the current file. What I would like to do, is checking if the resource in the external resource file is the same that the one it the current file. This way, I could reimport out of date resources in projects that were started long ago when the resources where different. VW checks if the external resource is the same as the local one all the time. For example : -if you import a external symbol, it will display the "replace resource dialog" only in there is a difference between the local and external symbol. - in a resource popup window (e.g. textures popup) the resource is only displayed twice if the local and the external version are not the same... In short : How to do this check myself? Quote Link to comment
Vectorworks, Inc Employee klinzey Posted June 26, 2013 Vectorworks, Inc Employee Share Posted June 26, 2013 If you use BuildResourceList it will handle it automatically. If you build the resource list with the local file and the resource file and there is a conflict the local resource will show up as the "actual name" and the resource form the resource file will show as "actual name(resource filename.vwx)" Once you build the resource list you can check if GetActualNameFromResourceList and GetNameFromResourceList are the same. If not the resource in the resource file is different than the local file. As far as I know there is no other way in Vectorscript to do this because Vectorscript has limited access to files. Quote Link to comment
Musisback Posted June 28, 2013 Author Share Posted June 28, 2013 Thanks that will help a lot. Also, is it possible to import a new version of a resource to the current file with out getting the "replace resource" dialogue? if I erase it prior importing, it will be erased of my drawing... Quote Link to comment
Vectorworks, Inc Employee klinzey Posted July 1, 2013 Vectorworks, Inc Employee Share Posted July 1, 2013 I haven't tested this but when you import you need to use the function ImportResToCurFileN (listID:LongInt,index:LongInt,callback:Function):Handle the callback function takes a string and returns an integer. 0 = Don't import 1 = Replace 2 = Rename 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.