I need to do a small application that shows an assembly structure just like Revision Manager does.
This is, using a kind of datagridview with several data columns combined with a treeview in the first column. (see picture attached)
Does anybody know if that is a standard control?
Any information will be welcome!
Solved! Go to Solution.
I haven't found a control like that yet, but that doesn't mean it doesn't exist. You can however write a simple recursive function that goes through all subassemblies using either SolidEdge or Revision Manager. For my purposes I could get away with only using linked documents for the top aseembly in Revision Manager, but like occurences in SolidEdge, they only go one level deep. (If I'm wrong on this and there is a way around it, please let me know)
This is the basic skeleton of the function I use for moving and editing an assembly. If you want to use the Revision Manager API it would look pretty much the same only using linkedDocument insead of occurrences.
Public Sub Deconstruct(byVal fileName As String) Dim assembly as SolidEdgeAssembly.AssemblyDocument = solidApp.Documents.open(fileName) Dim occurrence As SolidEdgeAssembly.Occurrence For Each occurrence in assembly.Occurences if occurrence.type = SolidEdgeFramework.ObjectType.igSubAssembly Then 'Fill your table with necessary data Deconstruct(Occurence.OccurenceFileName) Else 'Fill your table with necessary data End If Next End Sub
My problem is not to go through the assembly parts (That is the easy part ).
I was just looking for the .Net control to show the information just like Rev manager does.
Anyway i already found a C# project called "TreeGridView" that is a good starting.
I'm a little stuck doing drag&drop of grid rows because the behaviour is not exactly what a datagridView does but i'm still investigating...
Thanks for all,
I have used TreeListView from this Codeplex project in my Pack and Go for Solid Edge which is open source.
Though it does not implement the exact heirarchy of the model tree on the control, the control itself is extremely simple to use with most methods similar to those of a ListBox.
Here's a preview:
Also a tutorial is available on how to build this program from scratch.