iCAx开思工具箱
标题:
通过CAA如何获取三维投影到二维drawing中生成的点的坐标????
[打印本页]
作者:
sunmz_wjxy
时间:
2013-10-7 19:44
标题:
通过CAA如何获取三维投影到二维drawing中生成的点的坐标????
只能取得投影生成的点的三维坐标,现在我只能取得此生成点的X和Y的坐标,但一直无法取得Z轴的坐标值。
代码如下:
CATIDftGenGeomAccess *piGenGeomAccess = NULL;
IUnknown *piGenView = NULL;
if (NULL != piCurrentView)
{
if (SUCCEEDED( piCurrentView->GetApplicativeExtension(IID_CATIDftGenView,&piGenView)))
{
if (SUCCEEDED( piGenView->QueryInterface(IID_CATIDftGenGeomAccess, (void**) & piGenGeomAccess) ) )
{
CATIUnknownList * piList = NULL;
// Get a list containing all Generated Geometry of the view.
if( SUCCEEDED( piGenGeomAccess->GetAllGeneratedItems(IID_CATIDftGenGeom, &piList) ) )
{
unsigned int piListSize = 0;
piList->Count(&piListSize);
CATIDftGenGeom * piGenGeom = NULL;
IUnknown * item = NULL;
CATUnicodeString PartName;
CATIVisProperties *piVisProp = NULL;
CATVisPropertiesValues ioValues;
CATVisPropertyType iPropertyType = CATVPColor;
// Loop on all Generated Geometry of the view.
for(unsigned int i=0 ; i<piListSize ; i++)
{
if( SUCCEEDED( piList->Item(i, &item) ) )
{
if(SUCCEEDED( item->QueryInterface(IID_CATIDftGenGeom, (void**) & piGenGeom) ) )
{
// 只能获得X和Y
IDMPoint2D * Point2D = NULL;
if (SUCCEEDED(piGenGeom->QueryInterface(IID_IDMPoint2D,(void **)& Point2D)))
{
double pt1[2];
Point2D->GetPointData(pt1);
}
作者:
sunmz_wjxy
时间:
2013-10-8 08:46
怎么没人呀!!!!
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3