FlexPro
HistoryBase
Engineering
Training
Downloads
FlexPro-Support
Wissen
Community
Über Uns
Referenzen
Jobs
Allgemeiner Kontakt
Händlerverzeichnis
FlexPro-Support
DE
EN
FR
Placeholder
Produkte und Lösungen
Support und Downloads
Unternehmen
Magazin
Kontakt
Sprache
MyWeisang

Account Einstellungen

Topic

Automatic Data Export

Startseite ' Community ' Automation and VBA ' Automatic Data Export

  • Dieses Thema hat 4 Antworten sowie 2 Teilnehmer und wurde zuletzt vor vor 11 Jahren von Anonym aktualisiert.
Anzeigen von 5-Stellen - 1 bis 5 (von insgesamt 5)
  • Autor
    Beiträge
  • #35174
    Anonym
    Gast

    Is it possible to automate the following export process using FP Script or i need to use VBA for the same ?

    There are multiple folders containg the measured files .

    I need to export the processed document with the same name as that of the folder’s name .

    The process is first folder to be activated, updated & the document to be exported to a local drive with the same name as that of the folder.

    And then the next folder to be activated & the above process will follow for the rest of the files in the ascending order.

    I tried the same with macro but am unable to update the export file name.

    Kindly help me in this .

    Thanks in advance.

    #35178
    Anonym
    Gast

    Is it possible to automate the following export process using FP Script or i need to use VBA for the same ?

    There are multiple folders containg the measured files .

    I need to export the processed document with the same name as that of the folder’s name .

    The process is first folder to be activated, updated & the document to be exported to a local drive with the same name as that of the folder.

    And then the next folder to be activated & the above process will follow for the rest of the files in the ascending order.

    I tried the same with macro but am unable to update the export file name.

    Kindly help me in this .

    Thanks in advance.

    #35175
    Bernhard Kantz
    Teilnehmer

    The export task described has to be done via VBA programming.
    The approach can be as follows: Accumulate all measurement folders (e.g. with the .Objects() property of the containing folder) in a FPObjects collection. In the loop over these folders, use .BlendIn to activate them in their parent folder. Update the document and export it using the .Name of the folder.

    #35176
    Anonym
    Gast

    Thanks a lot for your quick reply .

    And i am using the following code without a loop

    But still i didn’t get the correct way to update the export files name as that of the folder name .

    Sub Export()

    ‘ Export

    ActiveDatabase.TaskWindows(fpTaskWindowFolders).Activate
    ActiveDatabase.Selection.SelectObject _
    “3_Import_Data140512ECA-MPTRT7V0Mot1195e.FLD”
    ActiveDatabase.SelectedObject.BlendIn
    Application.UpdateAll
    ActiveDatabase.TaskWindows(fpTaskWindowEventLog).Activate
    Windows(“10_Export_Dokument”).Activate
    Databases(“E:ED_EEIPP 12032014C_Sample_Final_Auto.FPD”).Activate
    Windows(“10_Export_Dokument”).Activate
    ActiveDatabase.ActiveObject.Selection.Export fpExportFormatJPEG, _
    “C:UsersKLS5KORDesktop10_Export_Dokument.jpg”
    End Sub

    #35177
    Bernhard Kantz
    Teilnehmer

    An implementation of the proposed approach may be as following:

    [code]
    Option Explicit

    Private Const sPath = “C:UsersKLS5KORDesktop”

    Public Sub ExportDocuments()
    ‘ get document to be exported
    Dim oDoc As Document
    Set oDoc = ActiveDatabase.RootFolder(“Document”, fpObjectTypeDocument)
    ‘ collect all folders
    Dim coFolders As FpObjects
    Set coFolders = ActiveDatabase.RootFolder.Objects(fpObjectTypeFolder)
    ‘ loop over folders
    Dim oFldr As Folder
    For Each oFldr In coFolders
    oFldr.BlendIn
    oDoc.Update
    oDoc.Export fpExportFormatPNG, sPath & oFldr.Name & “.png”
    Next oFldr
    End Sub
    [/code]

    The subroutine will export the document Document consecutively for all folders blended in. If one wants to export only a subset of folders one has to use a regular expression instead of the type specifier.

    A final remark: Synthetic pictures (as diagrams or text) look better when exported in the (lossless) Portable Network Graphics (.png) format. The JPEG format is better suited for photographs.

Anzeigen von 5-Stellen - 1 bis 5 (von insgesamt 5)
  • Du musst angemeldet sein, um auf dieses Thema antworten zu können.