Jump to content
Developer Wiki and Function Reference Links ×

Checking resources up to date status.


Recommended Posts

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?

Link to comment
  • Vectorworks, Inc Employee

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.

Link to comment
  • Vectorworks, Inc Employee

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

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.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...