Hi im Currently working on c# automation.Since im using autocad interop im not able to understand the process of setting
variable in autocad..I have drawing files with different dimensionstyles used inside..I can filter the dimesion by selectionset.but the problem is im filterring through dimstyle name.Is there any dxf code for selecting all kind of dimension styles.So that it will be useful for me.Im completely new to to Autocad,.
But my problem is i need to apply one particular standard dimstyle to all my drawings..Can someone help how i could set variable to my new dimstyle(new).this is my code for setting variable ,but its not updating in my current document.
this is my code;
double a = Convert.ToDouble((acadDocument.GetVariable("DIMASZ")));
object b = Convert.ToDouble(2.5);
acadDocument.SetVariable(
"DIMASZ", b);
Firstly, some comments not directly answers your question here, but I thought it is important for you to know, seeing your other post.
It is not important that you use C# or VB.NET to do your code. Rather it is very important for beginner to know which AutoCAD programming API is used. In this forum, (and most AutoCAD custom programmers are doing) it is ObjectARX .NET API.
With the few lines of code you showed here, obviously, you are using COM API, which is often the topic in the "Visual Basic Customization forum, even you use C#. It is OK to ask COM API question here, a long as you know what you are using.
Back to your question.
Setting "DIMxxxx" system variable does not change DimStyles defined in current document. It only create document overrides, which works with current ActiveDimStyle together to present dimension in the current drawing. If you want to persist the changes made through setting system variables "DIMxxxx", you need to call AcadDimStyle.CopyFrom() method with ThisDrawing as source, be it the active dimstyle, or a dimstyle you just created.
Norman Yuan