Distribute external rule directories iLogic

Distribute external rule directories iLogic

Neil_Cross
Mentor Mentor
197 Views
2 Replies
Message 1 of 3

Distribute external rule directories iLogic

Neil_Cross
Mentor
Mentor

Is there a way to distribute the iLogic External Rule Directories via a file copy rather than using export/import through XML? 

I want to be able to copy a file to a number of workstations to ensure the setting is properly distributed rather than request users manually import a XML file.

I've found the directory named in the user.config file in Appdata but copying that file to a new workstation doesn't seem to work.

Cheers

0 Likes
198 Views
2 Replies
Replies (2)
Message 2 of 3

Curtis_Waguespack
Consultant
Consultant

Hi @Neil_Cross , What I typically do is use some code to set the external rules path. There are a few ways to do this on startup, but I discuss on that uses Inventor's startup application options at this link from last week. I think I used Powershell to do this in the past as well.

 

https://forums.autodesk.com/t5/inventor-programming-ilogic/addvbfile-getting-document-and-applicatio...

 

That might give some ideas.

 

But to answer your question directly, I'm not aware of a file to copy over for this, but would be interested in knowing this as well.

 

Hope that helps,

Curtis

EESignature

0 Likes
Message 3 of 3

JelteDeJong
Mentor
Mentor

In the latest versions of inventor (I can't remember if it was 2024 or 2025), the  "external rule directories" settings are in the "UserApplicationOptions.xml".

The following PowerShell would add an extra path to "c:\temp\".

$filePath = [System.Environment]::ExpandEnvironmentVariables("%appdata%\Autodesk\Inventor 2025\UserApplicationOptions.xml")

$doc = New-Object System.Xml.XmlDocument

$doc.Load($filePath)

$root = $doc.DocumentElement

$settingNode = $root.SelectSingleNode("//iLogic/ExternalRuleDirectories")

# Create node and attribute
$pathAttribute = $doc.CreateAttribute("Path")
$pathAttribute.Value = "c:\temp\"

$dirNode = $doc.CreateElement("ExternalRuleDirectory")
$dirNode.Attributes.Append($pathAttribute)

# Add new node to settingNode
$settingNode.AppendChild($dirNode)

$doc.Save($filePath)

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com