Could you tell me how mark files to apply a macro.. i mean something like BATCH, i click to folder browse and then i get a list of files... then i`ll mark which files have to by modify.
First you need to set the SelectionMode property of the ListBox to MultiExtended.
This will enable picking multiple files using Ctrl and Shift keys.
The following worked for me:
Dim sFiles As String = String.Empty For Each oItem As Object In lstfiles.SelectedItems sFiles += oItem.ToString + Environment.NewLine Next
This will give you the filenames picked which you can use in Solid Edge.
Hope you find this useful.
Dim oPropertySets As New SolidEdgeFileProperties.PropertySets
Dim oProperties As SolidEdgeFileProperties.Properties
Dim oProperty As SolidEdgeFileProperties.Property
Dim sFileName As String
For Each obj As Object In lstFiles.SelectedItems Try sFileName = obj.ToString oPropertySets.Open(sFileName, False) oProperties = oPropertySets.Item("Custom") oProperty = oProperties.Add("Approved by", "Tushar") oPropertySets.Save() oPropertySets.Close() Catch ex As Exception Console.WriteLine(ex.Message) End Try Next
Samples for Solid Edge on CodePlex is a good place to start. Be aware that there are several Solid Edge APIs for working with file properties depending on what you're doing.
Download solidedgesamples.codeplex.com.zip and extract.
To work with file properties inside of Solid Edge (SolidEdgeFramework).
To work with file properties without Solid Edge running (SolidEdgeFileProperties).
You can actually work with file properties using the Revision Manager API but I don't have an example of that at the moment.