Reputation: 930
AutoCAD has a nifty way of changing system variables through its API
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable(string, object)
the string is the system variable name--in my case "WIPEOUTFRAME"
the object is the setting--I want to set it to 0.
I've used the method for other system variables and it works, but not this one.
Instead I get the eInvalidInput error at run time.
I've verified that WIPEOUTFRAME is correct (I can set it via the command line in autoCAD) and I verified that the value is 0.
I've also used the GetSystemVariable(string) method, which returns the setting as an object, to verify the program understands WIPEOUTFRAME, and that it can return a value of 0. It does. Also, I've confirmed the type of object it returns: INT16.
I've also passed the object returned by GetSystemVariable to SetSystemVariable and it works! Even when I make sure the value of WIPEOUTFRAME is 0. It's the only time I got the method to work. But of course, I want to change the value from 1 to 0, so while it confirms that the method CAN work, passing the same object doesn't help me with changing the value.
I've tried passing the value 0 to the parameter as an object, as an int16 object, as simply 0, as a string, and so on... no success.
Could this be a bug in the API, or can anyone tell me what I am missing?
Upvotes: 1
Views: 764
Reputation: 930
Solved--Without locking the application and creating a transaction, the API would not accept the input.
Upvotes: 1