É possível criar um código que ordene a árvore de construção de um assembly?
Reposicionando conforme a necessidade?
You can create a code that orders the tree to build an assembly?
Repositioning as needed?
Posted by: Edson Silva de JesusPost date: 12/7/2009 10:53:49 PM
I think this is what you are after. This is in VB6 and sorts based on Filename:
' Connect to Solid Edge. Ensure it is an Assembly file that is open.
On Error GoTo 100
Set objApp = GetObject(, "SolidEdge.Application")
100 MsgBox "There are not any instances of Solid Edge running!", vbExclamation, "How did you even get to this point?"
If objApp.ActiveDocumentType igAssemblyDocument Then
MsgBox "This program is only for Assemblies!", vbOKOnly, "Wrong document type ..."
' Connect to active document
Set objDoc = objApp.ActiveDocument
' Prepare to begin sorting process
If objApp.ActiveDocument.Occurrences.Count = 0 Then
MsgBox "There is nothing to sort!", vbOKOnly, "Assembly has no components."
' Determine and assign looping based on total child count
For x = 1 To .Count - 1
objApp.StatusBar = "Sorting " & .Item(x + 1).Name & " -- (Item " & x & " of " & .Count & ")"
' If the next item is less than the current item
If UCase(.Item(x + 1).Name)
' It is, so check against all previous items to this point
y = 1
For z = 1 To .Count - 1
.ReorderOccurrence .Item(x + 1), .Item(y), 1
y = y + 1
objApp.StatusBar = ""
Posted by: Bill LedbetterPost date: 12/9/2009 2:40:24 AM
Hello Bill, sorry for answering only now.
I would like to thank him for his help.
A big hug
Posted by: Edson Silva de JesusPost date: 5/3/2010 2:06:59 AM