.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fatal error override WorldDraw

2 REPLIES 2
Reply
Message 1 of 3
latoge
407 Views, 2 Replies

Fatal error override WorldDraw

Hi,

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

2 REPLIES 2
Message 2 of 3
Balaji_Ram
in reply to: latoge

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 ?



Balaji
Developer Technical Services
Autodesk Developer Network

Message 3 of 3
latoge
in reply to: latoge

Hi,

Thank you for your answer.  It's a good idea, I will work on that !

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost