Changing CADWorx Structure Configuration File

Posted by: TroyM

Changing CADWorx Structure Configuration File - 11/15/22 07:31 AM

Is there a way to change the CADWorx Structure 2020's (or later) configuration file from a LISP routine? I've made a series of custom client selector buttons and each button runs lisp routines to change settings specific to each client (template paths, tool palette path, etc.). However, I'd like to also be able to change the CADWorx Structure configuration file with each client.
Posted by: Matt.Worland

Re: Changing CADWorx Structure Configuration File - 11/16/22 09:52 AM

Kind of... It's a simple text file, so if you can parse it out and find the settings you want, then you can change them. But I don't think there is not an easy way to refresh the settings until a restart of CAD.
Posted by: TroyM

Re: Changing CADWorx Structure Configuration File - 11/16/22 10:52 AM

Is it possible to share the text file or a portion of the text file related to changing the config file?
Posted by: Matt.Worland

Re: Changing CADWorx Structure Configuration File - 11/16/22 11:41 AM

I don't have any code that changes the config file.
I'd look here at the concepts:
https://www.afralisp.net/autolisp/tutorials/file-handling.php
Then read the entire file into memory.
Search each line for your setting.
Change the setting
close config file
create a new file to overwrite the existing config file

Once you update the config file it can be shared with others to use the same file.

Usually, the settings only need to be set once, so you can just set them, then put the file in a location all users can see.