SymbolUtilityServices Version Change?

SymbolUtilityServices Version Change?

Anonymous
Not applicable
605 Views
3 Replies
Message 1 of 4

SymbolUtilityServices Version Change?

Anonymous
Not applicable
When I need to find the space I was in for 2006 in wrote this
SymbolUtilityServices service = new SymbolUtilityServices();
currentSpaceId = service.GetBlockModelSpaceId(HostApplicationServices.WorkingDatabase)

This worked just fine


Now when I try this using the acdbmgd and acmgd references from AutoCAD 2008 the project compiles but when I run the app I get this error:
--> System.MissingMethodException: Method not found: 'Autodesk.AutoCAD.DatabaseServices.ObjectId Autodesk.AutoCAD.DatabaseServices.SymbolUtilityServices.GetBlockModelSpaceId(Autodesk.AutoCAD.DatabaseServices.Database)'.

To make it work I have to now use:
currentSpaceId = SymbolUtilityServices.GetBlockModelSpaceId(HostApplicationServices.WorkingDatabase)

am I doing something wrong? Or has something changed
0 Likes
606 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable
Your code was wrong to start with. You
shoudn't create instances of that class.

The method you're calling is static.

--
http://www.caddzone.com

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

wrote in message news:5570207@discussion.autodesk.com...
When I need to find the space I was in for 2006 in wrote this
SymbolUtilityServices service = new SymbolUtilityServices();
currentSpaceId = service.GetBlockModelSpaceId(HostApplicationServices.WorkingDatabase)

This worked just fine


Now when I try this using the acdbmgd and acmgd references from AutoCAD 2008 the project compiles but when I run the app I get this error:
--> System.MissingMethodException: Method not found: 'Autodesk.AutoCAD.DatabaseServices.ObjectId Autodesk.AutoCAD.DatabaseServices.SymbolUtilityServices.GetBlockModelSpaceId(Autodesk.AutoCAD.DatabaseServices.Database)'.

To make it work I have to now use:
currentSpaceId = SymbolUtilityServices.GetBlockModelSpaceId(HostApplicationServices.WorkingDatabase)

am I doing something wrong? Or has something changed
0 Likes
Message 3 of 4

Anonymous
Not applicable
Yes, I see that now but if I try
currentSpaceId = SymbolUtilityServices.GetBlockModelSpaceId(HostApplicationServices.WorkingDatabase);

using references to autocad 2006 the compiler gives me this error:

An object reference is required for the nonstatic field, method, or property 'Autodesk.AutoCAD.DatabaseServices.SymbolUtilityServices.GetBlockModelSpaceId(Autodesk.AutoCAD.DatabaseServices.Database)' (CS0120)
0 Likes
Message 4 of 4

Anonymous
Not applicable
For anyone interested, changes have been made.
By Reflecting both 2006 and 2008 acdbmgd.dll and looking at
GetBlockModelSpaceId we find these differences:

2007: public static unsafe ObjectId GetBlockModelSpaceId(Database databasePointer)


2006: public unsafe ObjectId GetBlockModelSpaceId(Database databasePointer)

So it has been changed to a static method in 2008.
I guess my code wasn't wrong for the 2006 version.
0 Likes