Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
bradeneuropeArthur
in reply to: Anonymous

 Public Sub PackAndGoSample(a As String)
        'SET THE APPLICATION TO 64 BIT
        Dim fio As System.IO.FileInfo
        Dim dirio As System.IO.DirectoryInfo

        fio = New System.IO.FileInfo(a)
        dirio = New System.IO.DirectoryInfo(fio.Directory.FullName)

        Dim oPacknGoComp As New PackAndGoLib.PackAndGoComponent

        Dim oPacknGo As PackAndGoLib.PackAndGo
        Try
            MkDir("C:\Temp\PackAndGo")
        Catch ex As Exception

        End Try

        oPacknGo = oPacknGoComp.CreatePackAndGo(a, "C:\Temp\PackAndGo")

        ' Set the design project. This defaults to the current active project.
        oPacknGo.ProjectFile = "C:\Vault\XYZ.ipj"

        Dim sRefFiles = New String() {}
        Dim sMissFiles = New Object

        Dim sRefcingFiles = New String() {}

        ' Set the options
        oPacknGo.SkipLibraries = True
        oPacknGo.SkipStyles = True
        oPacknGo.SkipTemplates = True
        oPacknGo.CollectWorkgroups = False
        oPacknGo.KeepFolderHierarchy = True
        oPacknGo.IncludeLinkedFiles = True

        ' Get the referenced files
        oPacknGo.SearchForReferencedFiles(sRefFiles, sMissFiles)

        oPacknGo.SearchForReferencingFiles(sRefFiles, sRefcingFiles, False, dirio.Parent.FullName & "\_Dwg")

        ' Add the referenced files for package
        'oPacknGo.AddFilesToPackage(sRefFiles)
        'oPacknGo.AddFilesToPackage(sRefcingFiles)

        Dim xa = New String(sRefFiles.Length + sRefcingFiles.Length - 1) {}
        sRefFiles.CopyTo(xa, 0)
        sRefcingFiles.CopyTo(xa, sRefFiles.Length)

        'oPacknGo.AddFilesToPackage(sMissFiles)
        ' Start the pack and go to create the 
        oPacknGo.AddFilesToPackage(xa)
        'MsgBox(xa.Length)
        

        oPacknGo.CreatePackage(True)
    End Sub

Regards,

Arthur Knoors

Autodesk Affiliations:

Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:Drawing List!|Toggle Drawing Sheet!|Workplane Resize!|Drawing View Locker!|Multi Sheet to Mono Sheet!|Drawing Weld Symbols!|Drawing View Label Align!|Open From Balloon!|Model State Lock!
Posts and Ideas:Dimension Component!|Partlist Export!|Derive I-properties!|Vault Prompts Via API!|Vault Handbook/Manual!|Drawing Toggle Sheets!|Vault Defer Update!


! For administrative reasons, please mark a "Solution as solved" when the issue is solved !