WMS Layer - Resample Raster

WMS Layer - Resample Raster

Anonymous
Not applicable
1,736 Views
2 Replies
Message 1 of 3

WMS Layer - Resample Raster

Anonymous
Not applicable

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?

0 Likes
1,737 Views
2 Replies
Replies (2)
Message 2 of 3

Daniel.Du
Alumni
Alumni

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

0 Likes
Message 3 of 3

keith_sowinski
Advocate
Advocate

@Daniel.Du 

Could this be possible using the FDO Provider for WMS capabilities as described in my posted question in the C3D customization forum?

"Resample" or "Clip" expression for WMS connection - Autodesk Community - Civil 3D

0 Likes