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.
In the Configurator 360 Admin interface, select the Options tab Shared Files tab.
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.
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.
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).
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.
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.
The calls to the GetSharedDataFile() function are made from specific wrapper parts. Follow these steps
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.
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.
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.
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.
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