.NET

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

Fatal error override WorldDraw

139 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: 663
Registered: ‎03-21-2011
Message 2 of 3 (109 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 (90 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 !

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community