AutoCAD Map 3D Developer

Posts: 3
Registered: ‎03-27-2012
Message 1 of 2 (379 Views)

WMS Layer - Resample Raster

379 Views, 1 Replies
03-27-2012 07:04 AM



i have a question concerning Display Manager in Map 3 D 2012. I loaded a layer with a WMS datasource. If the layer is loaded, you can click with right mouse button and activate the function resample raster. How can i do this programatically with NET API?

Board Manager
Posts: 170
Registered: ‎12-23-2008
Message 2 of 2 (226 Views)

Re: WMS Layer - Resample Raster

08-01-2012 08:19 PM in reply to: ohlsen1980

Unfortunately, there is not such .NET API to do that. 


I searched in our knowledge base and find following an unsupported OjectARX API call QueryToView in AcMapDMGisGridElement  to implement the resample operation.  However this kind of API is not exposed with .NET API, so you need to use PInvoke to wrap it to .Net. 


Here is a code snippet for your reference. 

/// <summary>
/// Update this grid element according to current viewport.
/// </summary>
/// <returns>
/// Returns Acad::eOk if successful; otherwise, returns a different error code.
/// </returns>
Acad::ErrorStatus QueryToView();

Bool DoQueryToView()
AcAxDocLock locker;
SmartTransaction xaction(m_id.database());//m_id :given the object Id of the image
if (xaction.hasTransactionStarted())
AcMapDMGisGridElement* pGisGridElement;
if(Acad::eOk == xaction.getObject(pGisGridElement, m_id, AcDb::kForWrite))
if (Acad::eOk == pGisGridElement->QueryToView())
return true;
return false;



Daniel Du
Developer Technical Services
Autodesk Developer Network

You are not logged in.

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

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