Community
Vault Customization
Share your knowledge, ask questions, and explore popular Vault API, Data Standard, and VBA topics related to programming, creating add-ins, or working with the Vault API.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Set thumbnail

4 REPLIES 4
Reply
Message 1 of 5
marchenko.andrii
433 Views, 4 Replies

Set thumbnail

Hi all.

I have some problem. I upload to the Vault server files, but thumbnail not show's. I can get thumbnail of current document, but how i can attach my thumbnail to file iteration? 

Thank you.

4 REPLIES 4
Message 2 of 5

The Vault Server automatically extracts the thumbnail for known file types.  If the server doesn't know how to read the thumbnail, then there is no way to set the thumbnail property.



Doug Redmond
Software Engineer
Autodesk, Inc.

Message 3 of 5

Well for example I can Update File Properties:

System.Drawing.Size size = new System.Drawing.Size(200, 200);
Stream image = new MemoryStream(System.IO.File.ReadAllBytes("D:\\123.jpg"));
long[] fileIDs = new long[1];
fileIDs[0] = file.EntityMasterId;
VDF.Vault.Currency.Properties.PropertyDefinition prop = Statics.Connection.PropertyManager.GetPropertyDefinitionBySystemName("Thumbnail");
long[] propIDs = new long[1];
propIDs[0] = prop.Id;
ThumbnailInfo thumbnailInfo = new ThumbnailInfo(ThumbnailInfo.ThumbnailType.Thumbnail, System.IO.File.ReadAllBytes("D:\\123.jpg"));
object[] img = new object[1];
img[0] = thumbnailInfo.Image;
Statics.Connection.WebServiceManager.DocumentService.UpdateFileProperties(fileIDs, propIDs, img);

 

But on last line i have error with code "0". It's  because I use Vault Basic or am I doing something not right? If I have a Vault Professional I can do so Thumbnail that will appear in the Vault or not?

Message 4 of 5
RPeter
in reply to: Redmond.D

I've got a lot of TIF images (old scanned drawings) some of them have a Thumbnail, the most of them don't. Its strange that an raster image doesn't have an thumnail.

Now we're on Vault 2015 and they want to use the Thin Client so no thumbnail becomes an issue.

Message 5 of 5
RPeter
in reply to: RPeter

I've created this code:

Dim tmpimg As String = "C:\temp\thumb.wmf"
'Resize the image to 256x256 pixels
Dim imgs As System.Drawing.Image = ShellFile.ResizeImage(System.Drawing.Image.FromFile(dest), 256, 256) imgs.Save(tmpimg, System.Drawing.Imaging.ImageFormat.Wmf) imgs.Dispose()
'Set up a new thumbnailinfo Dim thumbnailinfo As New VDF.Vault.Currency.Properties.ThumbnailInfo(0, System.IO.File.ReadAllBytes(tmpimg)) 'Creating a new dictionary that contains the value for the new thumbnail
Dim dict As New Dictionary(Of ACW.PropDef, Object) dict.Add(ThumbnailDef, thumbnailinfo.Image)
'update the thumbnail
'the error is generated here Dim veu As IExplorerUtil = ExplorerLoader.LoadExplorerUtil(VLT_Conn.Server, VLT_Conn.Vault, VLT_Conn.UserID, VLT_Conn.Ticket) veu.UpdateFileProperties(fle, dict) veu = Nothing

 The only problem is that I get this error:

"At least one property failed to update"

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report