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?
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>
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