TheSwamp
Code Red => .NET => Topic started by: JimAndi on August 23, 2011, 10:15:32 AM
-
Hi All,
I am getting a Error with this code:
Double LTSCALEV, DIMSCALEV;
DIMSCALEV = Convert.ToDouble(dsTITLEBLOCK4.Rows[0]["DIMSCALE"].ToString());
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMSCALE", DIMSCALEV);
I am getting a "eInvalidInput" error with the value of DIMSCALEV
-
Since this works fine
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMSCALE", 2.5);
I would think your problem is with
DIMSCALEV = Convert.ToDouble(dsTITLEBLOCK4.Rows[0]["DIMSCALE"].ToString());
-
public static void SetSystemVariable(string name, object value)
-
Another possible pitfall, albeit one AutoCAD takes care of, AFAIK:
System.Convert.ToDouble("2.5") might return 25.0. If in doubt, throw in System.Globalization.CultureInfo.InvariantCulture.
-
I tried this: Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMSCALE", 12.0); and get the same error
-
What year and or vertical are you using?
Ad if you try this all by itself does it fail?
[CommandMethod("DimScaler")]
public void DimScaler()
{
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMSCALE", 12.0);
}
-
VS-2010 .NET 4.0 in C#. AutoCAD 2012
This works fine
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("LTSCALE", 6.0);
This errors
Autodesk.AutoCAD.ApplicationServices.Application.SetSystemVariable("DIMSCALE", 12.0);
-
Fixed it.... must be inside the document.LockDocument(); function
-
Fixed it.... must be inside the document.LockDocument(); function
No, it doesn't. It will depend entirely on the context of where it's being called from.