.NET

Reply
Active Member
latoge
Posts: 10
Registered: ‎03-09-2012
Message 1 of 3 (152 Views)

Fatal error override WorldDraw

152 Views, 2 Replies
01-30-2013 06:51 AM

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

ADN Support Specialist
Balaji_Ram
Posts: 749
Registered: ‎03-21-2011
Message 2 of 3 (122 Views)

Re: Fatal error override WorldDraw

02-06-2013 04:01 AM 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

Active Member
latoge
Posts: 10
Registered: ‎03-09-2012
Message 3 of 3 (103 Views)

Re: Fatal error override WorldDraw

02-13-2013 06:56 AM in reply to: latoge

Hi,

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

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.