Create Folder for Symbols in drawings

Create Folder for Symbols in drawings

Anonymous
Not applicable
775 Views
3 Replies
Message 1 of 4

Create Folder for Symbols in drawings

Anonymous
Not applicable

Hi All,

 

In a drawing,

I need to create a list of folders from A to Z

and place all the Sketch Symbols in the right folder, by using the first letter of the symbol.

So all the symbols starting with letter A to folder A and so on.

 

Thanks for your help.

 

Best Regards

Massimo

0 Likes
Accepted solutions (1)
776 Views
3 Replies
Replies (3)
Message 2 of 4

MechMachineMan
Advisor
Advisor

There was a solution to something very similar posted yesterday...

 

https://forums.autodesk.com/t5/inventor-customization/copy-sketched-symbols-with-folders/td-p/713142...


--------------------------------------
Did you find this reply helpful ? If so please use the 'Accept as Solution' or 'Like' button below.

Justin K
Inventor 2018.2.3, Build 227 | Excel 2013+ VBA
ERP/CAD Communication | Custom Scripting
Machine Design | Process Optimization


iLogic/Inventor API: Autodesk Online Help | API Shortcut In Google Chrome | iLogic API Documentation
Vb.Net/VBA Programming: MSDN | Stackoverflow | Excel Object Model
Inventor API/VBA/Vb.Net Learning Resources: Forum Thread

Sample Solutions:Debugging in iLogic ( and Batch PDF Export Sample ) | API HasSaveCopyAs Issues |
BOM Export & Column Reorder | Reorient Skewed Part | Add Internal Profile Dogbones |
Run iLogic From VBA | Batch File Renaming| Continuous Pick/Rename Objects

Local Help: %PUBLIC%\Documents\Autodesk\Inventor 2018\Local Help

Ideas: Dockable/Customizable Property Browser | Section Line API/Thread Feature in Assembly/PartsList API Static Cells | Fourth BOM Type
0 Likes
Message 3 of 4

bshbsh
Collaborator
Collaborator
Accepted solution

@MechMachineMan wrote:

There was a solution to something very similar posted yesterday...

 

https://forums.autodesk.com/t5/inventor-customization/copy-sketched-symbols-with-folders/td-p/713142...


****, I didn't see it and wrote some code. You beat me to it. 🙂

I'll post mine anyway. It's vba.

Public Sub SS_Subfolders()
    If ThisApplication.ActiveDocument Is Nothing Then
        Exit Sub
    Else
        If ThisApplication.ActiveDocument.DocumentType = kDrawingDocumentObject Then
            Dim InvDoc As Document
            Set InvDoc = ThisApplication.ActiveDocument
        Else
            Exit Sub
        End If
    End If
    
    Dim BP As BrowserPane
    Set BP = InvDoc.BrowserPanes.Item("Model")
    Dim SS_BN As BrowserNode
    Set SS_BN = BP.TopNode.BrowserNodes.Item("Drawing Resources").BrowserNodes.Item("Sketch Symbols")
    Dim SS_Coll As ObjectCollection
    Set SS_Coll = ThisApplication.TransientObjects.CreateObjectCollection
    Dim i As Long
    For i = 65 To 90
        SS_Coll.Clear
        For Each BrowserNode In SS_BN.BrowserNodes
            If (BrowserNode.NativeObject.Type <> kBrowserFolderObject) And (Left(BrowserNode.BrowserNodeDefinition.Label, 1) = Chr$(i)) Then
                SS_Coll.Add (BrowserNode)
            End If
        Next BrowserNode
        If SS_Coll.Count > 0 Then
            Set BF = BP.AddBrowserFolder(Chr$(i), SS_Coll)
        End If
    Next i
End Sub
Message 4 of 4

Anonymous
Not applicable

Hello,

 

Thanks, is it perfect!!

 

regards

Massimo

0 Likes