Hi,
I have a function that allows the user to set a color on a modified dimension (only the text of it). However, when this function is enabled and the user wants stretch the dimension, Autocad make a fatal error and close.
Here is where it crash (in red) :
----------------------------------------------------------------------------------------------------
public overridebool WorldDraw(Autodesk.AutoCAD.GraphicsInterface.Drawable drawable, Autodesk.AutoCAD.GraphicsInterface.WorldDraw wd)
{
if (showText || resetText)
{
Dimension dm = (Dimension)drawable;
dm.UpgradeOpen();
dm.Dimclrt = dimTColor;
dm.DowngradeOpen();
}
.......
}
-------------------------------------------------------------------------------------------------------------
I added this (in red) but it will just turn in round in my code with another function and made the fatal error still :
Dimension dm = (Dimension)drawable;
if(!dm.IsWriteEnabled)
{
dm.UpgradeOpen();
dm.Dimclrt = dimTColor;
dm.DowngradeOpen();
}
Let me know if you need to see more of my code. Thank you
Hi,
How about trying to create a clone of the dimension and then change its color and use it to draw ?
This way, it will not be needed to work with the original dimension.
If that does not help, can you please share a buildable sample project to demonstrate the problem ?