Unable to set coordinate system with RealDWG 2023.

Unable to set coordinate system with RealDWG 2023.

kevin_dangBW7DG
Explorer Explorer
1,473 Views
7 Replies
Message 1 of 8

Unable to set coordinate system with RealDWG 2023.

kevin_dangBW7DG
Explorer
Explorer

Hi, I'm working on upgrading our RealDWG library from r2022 to r2023.  However, we ran into a regression with setting the coordinate system using the AcDbGeoData setCoordinateSystem() method when writing a DWG file.

 

I was able to reproduce this in the CreateNT sample as well.  Using r2022, it would work without issues.  But running the same code in r2023, the method returns eNotApplicable instead.

 

Is there something that needs to be done differently in r2023?

AcDbGeoData* pGeoData = new AcDbGeoData;
pGeoData->setBlockTableRecordId(modelSpaceId);
pGeoData->postToDb(geoDataObjId);

// returns eOk in 2022, but eNotApplicable in 2023
pGeoData->setCoordinateSystem(AcString(L"UTM83-10"));

 

0 Likes
Accepted solutions (1)
1,474 Views
7 Replies
Replies (7)
Message 2 of 8

tbrammer
Advisor
Advisor

I have to admit that I'm not familiar with class AcDbGeoData. Anyway I try to help based on my experience with RealDWG 2022 and ObjectARX in general.

 

Maybe RealDWG 2023 must load some .DBX/.ARX/.DLL modules before you can call setCoordinateSystem().

I checked with ProcessMonitor which modules are loaded when  I execute setCoordinateSystem() in AutoCAD 2022:

AcAuthEnviron.crx
AcGeoLocationObj.dbx
AcParameter.crx
AcGeoLocationOE.crx
AcTcUi.dll, AcTc.dll
AcAuthEnviron.arx
AcGeoLocationUI.arx

Make sure that the .dbx and .crx modules are loaded.

 

The docs for AcDbGeoData::setCoordinateSystem(coords) say about the parameter coords:

The spatial coordinate system string. It can be the ID of the coordinate system or the XML/WKT representation. You must always use a coordinate system provided by AutoCAD since AutoCAD does not accept custom coordinate systems in your XML.

"UTM83-10" doesn't look like an XML string. So I suppose it is an ID. Where does AutoCAD search for this ID? Could it be that RealDWG can't find it?

 

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 3 of 8

kevin_dangBW7DG
Explorer
Explorer

Hi Thomas,

 

> I checked with ProcessMonitor which modules are loaded when  I execute setCoordinateSystem() in AutoCAD 2022...

 

When I tried running my repro using the CreateNT sample, the only DLL I saw get loaded when calling setCoordinateSystem() was AdSpatialReference.dll.  I did try loading the modules you listed, however, the only one I could load was AcGeoLocationObj.dbx.  The others don't seem to be available in the RealDWG SDK.

 

> "UTM83-10" doesn't look like an XML string. So I suppose it is an ID. Where does AutoCAD search for this ID? Could it be that RealDWG can't find it?

 

Yes, UTM83-10 should be an ID in this context.  I was able to read from a file that had this coordinate system using AcDbGeoData->coordinateSystem(), which returned as an XML.  This XML showed UTM83-10 as an ID in one of the nodes.  I had also tried copying the XML and passing that in as well, but it still just returns eNotApplicable.

 

I don't think the problem is in RealDWG not being able to find it since it is able to return the XML.  Also, it works fine in the RealDWG 2022 context, just not in 2023.

 

Thanks!

Kevin

0 Likes
Message 4 of 8

tbrammer
Advisor
Advisor

So you are still stuck. Unfortunately I don't have RealDWG 2023 and so I don't know how to investigate further. 

Maybe you should ask for support directly at TechSoft3D.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

0 Likes
Message 5 of 8

andy.zhang1
Autodesk
Autodesk
Accepted solution

Hi Kevin,

 

Could you please check if AdSpatialReference is installed correctly? For R2023, the location is <ProgramData>\Autodesk\Geospatial Coordinate Systems 14.09.

 

Regards

Andy

0 Likes
Message 6 of 8

kevin_dangBW7DG
Explorer
Explorer

Hi Andy,

 

Just checked the location you mentioned, and it looks like I don't have the 14.09 directory.  I only have Geospatial Coordinate Systems 14.04 to 14.08 apparently.  How would I get 14.09 installed?

 

Thanks,

Kevin

0 Likes
Message 7 of 8

andy.zhang1
Autodesk
Autodesk

Hi Kevin,

 

AdSpatialReference 14.09 is included in RealDWG 2023. You can try to re-install RealDWG 2023.

 

Regards

Andy

0 Likes
Message 8 of 8

kevin_dangBW7DG
Explorer
Explorer

Thanks Andy, looks like the problem really was due to the missing directory.  It works fine now after a proper install.

0 Likes