Inherited forms

Inherited forms

Anonymous
Not applicable
971 Views
10 Replies
Message 1 of 11

Inherited forms

Anonymous
Not applicable
As already signalled on this group, we are experiencing problems in using form inheritance on a .NET ACad extension as soon as we reference acmgd or acdbmgd objects. We noticed that acmgd and acdbmgd have different assembly version respect to what you see inside visual studio. Perhaps this bug could prevent visual studio designer to work properly.. anybody knows about it?
0 Likes
972 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
Welcome to the club.

I have some news on this. The rollup fixes to .NET that come with the .NET framework 3.5 seem to resolve some of the issues, but I haven't investigated if they address the issue with visual inheritance.

After installing .NET 3.5, The IDE can now load acdbmgd.dll and admgd.dll and can find types at design time that it could not before installing 3.5.

Please install the .NET framework 3.5 and lets us know if it solves any of your problems.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5844239@discussion.autodesk.com...
As already signalled on this group, we are experiencing problems in using form inheritance on a .NET ACad extension as soon as we reference acmgd or acdbmgd objects. We noticed that acmgd and acdbmgd have different assembly version respect to what you see inside visual studio. Perhaps this bug could prevent visual studio designer to work properly.. anybody knows about it?
0 Likes
Message 3 of 11

Anonymous
Not applicable
I've installed .Net Framework 3.5 but doesn't solve our problems.
When I open an inherited form in designer I receive this error:
"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: --- The base class '' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. "

and obviously all projects are successfully builded.
It's very frustrating developing for Autocad with managed ObjectArx.
Poor documentation, lot of bug, poor support....

What do you think about ADN Membership? I'm evaluating it, but I don't know if it helps in developing and supporting....
0 Likes
Message 4 of 11

Anonymous
Not applicable
I can't tell you whether ADN can help you with this.

AFAIK, there is no solution other than keeping AutoCAD types out of your designable classes.

What I do is avoid exposing public properties or methods that take/return types from the AutoCAD managed assemblies (private members do not seem to be a problem).

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5844477@discussion.autodesk.com...
I've installed .Net Framework 3.5 but doesn't solve our problems.
When I open an inherited form in designer I receive this error:
"The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the following classes in the file: --- The base class '' could not be loaded. Ensure the assembly has been referenced and that all projects have been built. "

and obviously all projects are successfully builded.
It's very frustrating developing for Autocad with managed ObjectArx.
Poor documentation, lot of bug, poor support....

What do you think about ADN Membership? I'm evaluating it, but I don't know if it helps in developing and supporting....
0 Likes
Message 5 of 11

Anonymous
Not applicable
Like this?

public partial class Form1 : Form {

private ObjectId id = ObjectId.Null;

public Form1() {
InitializeComponent();
}
}

If I inherits I receive the error from the IDE.
If I comment out the row " private ObjectId id = ObjectId.Null;" IDE shows me the inherited form....

I have same behaviour with 2006 and 2008 assembly!!
0 Likes
Message 6 of 11

Anonymous
Not applicable
Try putting them in a nested static type, like this:

public partial class Form1 : Form
{
private static class AcadTypes
{
public ObjectId id = ObjectId.Null;
}

}


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5844513@discussion.autodesk.com...
Like this?

public partial class Form1 : Form {

private ObjectId id = ObjectId.Null;

public Form1() {
InitializeComponent();
}
}

If I inherits I receive the error from the IDE.
If I comment out the row " private ObjectId id = ObjectId.Null;" IDE shows me the inherited form....

I have same behaviour with 2006 and 2008 assembly!!
0 Likes
Message 7 of 11

Anonymous
Not applicable
The project you posted opens fine on my system, with no errors.

I also created a few test projects from scratch, and added inherited forms that derive from base forms that have public properties using types from acdbmgd.dll, and I no longer have any of the problems I've ranted about here in the past. No matter what I do, the forms open in the designer without any WSODs.

I'm not sure at this point what has changed on my system to mysteriously cause the problems to vanish, and the only things I did was install the .NET Framework 3.5, and the Visual Studio SDK 4.0 (Feburary 2007). You might try downloading and installing that too, because I now have a hunch that it could also have something to do with it:

http://www.microsoft.com/downloads/details.aspx?FamilyID=51A5C65B-C020-4E08-8AC0-3EB9C06996F4

Another thing you do, is make sure the path to acdbmgd and acmgd (e.g., the path to acad.exe), is on your system PATH.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5844513@discussion.autodesk.com...
Like this?

public partial class Form1 : Form {

private ObjectId id = ObjectId.Null;

public Form1() {
InitializeComponent();
}
}

If I inherits I receive the error from the IDE.
If I comment out the row " private ObjectId id = ObjectId.Null;" IDE shows me the inherited form....

I have same behaviour with 2006 and 2008 assembly!!
0 Likes
Message 8 of 11

Anonymous
Not applicable
You're great!!

Changhing system path is the solution for me. Seems to work now!

I don't know if .NET Framework 3.5 also helps but now my configuration is:
- autocad 2006
- autocad 2008
- Visual studio 2005 SP1
- .NET Framework 3.5
- system path with [programfolder]\autocad 2008

If I remove path i receive the WSOD...

Thanks a lot!!

I think Autodesk has to pay us for this intensive debugging... I lost some days of works.

What to do u think about creating a technical blog and a programming book about .net and Autocad? We can write it and fill the lack of public documentation about managed libraries.
0 Likes
Message 9 of 11

Anonymous
Not applicable
You are right!
Putting ACad path on system path solve my problem at all, without changing a line of code..
I've modified the variable, reload VStudio and the designer works correctly, even if reference to Acdbmgd are not private. How did you discover this? Many thanks for this productive discussion..
0 Likes
Message 10 of 11

Anonymous
Not applicable
I don't know if that was all there is to it, because I've always had the path to ACAD.EXE on my system path, even when I was having the problems.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5845151@discussion.autodesk.com...
You are right!
Putting ACad path on system path solve my problem at all, without changing a line of code..
I've modified the variable, reload VStudio and the designer works correctly, even if reference to Acdbmgd are not private. How did you discover this? Many thanks for this productive discussion..
0 Likes
Message 11 of 11

Anonymous
Not applicable
I did not try to put ACad path on sys path with 2.0 framework only, but if I understood correctly you were in this situation. So I think the solution is framework 3.5 (or better patches for NET 2.0 contained in 3.5 package) + update of system path with ACAd dir
0 Likes