AutoCAD Map 3D Developer

AutoCAD Map 3D Developer

Reply
Member
3 Posts
0 Kudos
Registered: ‎03-27-2012
Post 1 of 2

WMS Layer - Resample Raster

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

Hello,

 

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?

ADN Support Specialist
294 Posts
17 Kudos
Registered: ‎12-23-2008
Post 2 of 2

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. 


<code_begin>
/// <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;
}

<code_end>

 



Daniel Du
Developer Technical Services
Autodesk Developer Network

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!