Sharing Files Across Designs

If you have a data file that needs periodical updates, or is required by more than one Configurator 360 design, it is not necessary to upload a copy with each design. Instead, upload the data file as a shared file. In your design rules, you can read the contents of a shared file using standard .NET or Intent functions. The shared file can be updated at any time, without changing or updating the designs.

Data files can come from any source, including databases, Excel, or hand-edited CSV or XML files.

To share files

  1. In the Configurator 360 Admin interface, select the Options tab Shared Files tab.

  2. Click the Choose Files button to select and upload the files to share. Use the New Folder button to create subfolders as needed. These files are shared with all catalog administrators.

Note: If you have multiple catalog administrators, this folder will be shared with all of the administrators. If you create subfolders in this data folder, you will need to create corresponding subfolders in your local folder, as explained in the next section.

Using shared files in iLogic and ETO rules

  1. Put the data files in a local folder named C:\C360_A360\.
    Note: To use a different folder, create a file named C:\C360_A360\LocalFolderPath.txt. In this text file, add one line that is the full path of the folder you selected to use.
  2. Install helper function. Autodesk provides versions of the GetSharedDataFile function that runs on a local machine, for iLogic and ETO. For ETO, install two Intent design files. To access these files, see Autodesk Configurator 360 Samples.

    For iLogic

    Copy the iLogicVb file to a folder outside your Inventor project workspace folder (for example, C:\iLogicRules). This is a global folder for external iLogic rules.

    Next, go to the Tools Options iLogic Configuration command to point iLogic to this folder. This command is on a drop-down menu at the bottom of the Options panel.

    Note: Do not include this file in the data that you upload to Configurator 360.

    For ETO

    Include the three IKS files in your Intent search path. The recommended location is ivHostlib (for example, C:\Program Files\Autodesk\Inventor ETO 20xx\Library\Inventor\ivhostlib).

  3. The GetSharedDataFile() function provides you access to a shared file.

    The function definition is:

    Function GetSharedDataFile(sharedFilePath As String) As String

    The sharedFilePath is the path to your shared file (relative to the root folder). Use forward slashes or backslashes as directory separators in the path. If the file is in the root folder itself, supply the "filename.ext". When it executes, the function returns a full Windows path to the file.

    In iLogic

    1. Call this function from a rule named C360_RefreshSharedData.

    2. Create this rule in the document that contains your C360-visible parameters. All shared data must be retrieved from this rule. Configurator 360 runs this rule when your design is loaded to make sure that it is using the latest version of the shared data.

    3. Use any file-reading functions to access the contents of the file.

    4. Select from one of the following ways to proceed:
    • Immediately store all data read from the file in persistent Inventor data structures. For example, parameters, properties, attributes. This data is not only in memory, but is saved with the Inventor file. This technique is convenient and robust, but sometimes less efficient than the following method.
    • Store some or all data read from the file in iLogic SharedVariables (or other nonpersistent memory) to be available to other rules in the future. Refer to those SharedVariables normally in other later rules. Run those other rules from C360_RefreshSharedData at the time new data is received. This technique minimizes time-consuming file operations, but is prone to errors due to neglecting to call these other rules from C360_RefreshSharedData.

    In ETO Intent

    The calls to the GetSharedDataFile() function are made from specific wrapper parts. Follow these steps

    1. Create a design in your project. Derive it from the C360CommonFileCollection design. Here's an example:
      Design MySharedFileCollection : C360CommonFileCollection
         Child MySharedFile As :C360SharedDataFile
           SharedPath = "MyFile.txt"
         End Child
      End Design
      

      In this design, each child part holds a single shared file. Add any parts you need. The system uses the SharedPath parameter as the argument to the GetSharedDataFile() function.

    2. In your root design, add a child part that implements the MySharedFileCollection design.
    3. To get the full Windows path to a shared file, read the value of the LocalPath rule on the C360SharedDataFile child part. Here's an example:
      Dim localPath As String = MySharedFileCollection.MySharedFile.LocalPath

      In ETO Intent, you can access the shared data at any point in your code. None of the restrictions noted above for iLogic apply to ETO.

  4. After testing locally, upload your shared data files to Configurator 360 as described above.
  5. Upload your design to Configurator 360.
    Note: Upload your shared data files before uploading any design that attempts to access them..

File versions

Update shared files on Configurator 360 at any time. The first time a shared file is referenced in a Configurator 360 modeling session, Configurator 360 checks for a newer version of the file. New sessions use the latest versions of all files. If you update a file while a session is running, the running session does not detect the newer version. Only subsequent sessions see the newer version.

If you open a model saved with an RFQ (Request For Quote) that was created with data from one or more shared files, the model continues to reference the original (old) versions used in the session when the model was originally generated.

Configurator 360 does not detect interdependencies between shared files. To make updates easy, it is best to combine all dependent information (for example, two tables from the same database) into a single file. By combining them into one file, you prevent a potential problem. If you do that, then a single Configurator 360 session would not be able to load a new version of one file together with an older, incompatible version of the second file. If you stored the two tables in two separate files, such an error could possibly happen.

Limitations

Do not mix ETO and iLogic access to shared data files within the same design. If your ETO design incorporates parts or subassemblies that contain iLogic rules, those rules should not access shared data files. Instead, read all the shared data from Intent rules and pass the required values to the iLogic components.

Sample iLogic rule

Read one or more shared files from the C360_RefreshSharedData rule in iLogic.

Here is a simple example of a C360_RefreshSharedData rule:

The AddVbFile statement provides the GetSharedDataFile function.

AddVbFile "C360SharedFilesAccess.iLogicVb"

Dim localPath As String = GetSharedDataFile("WidthFactor.txt")
Dim fileContents As String = IO.File.ReadAllText(localPath)

Dim widthFactorX As Double
If Double.TryParse(fileContents, widthFactorX) Then
 Parameter("WidthFactor") = widthFactorX
End If

This rule reads a text file with a single line containing a single numeric value. The rule assigns the value to a parameter named WidthFactor. That parameter can then be used in another rule to establish a relationship between two parameters:

Width = Length * WidthFactor