.NET

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

Fatal error override WorldDraw

150 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: 735
Registered: ‎03-21-2011
Message 2 of 3 (120 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 (101 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
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!