iCAx开思工具箱

标题: CAA问题:对投影圆标注它与直线间的距离 [打印本页]

作者: fly8bin    时间: 2008-5-20 15:51
标题: CAA问题:对投影圆标注它与直线间的距离
问题是这样:
我想创建3D投影元素(圆和直线)之间的距离,这个尺寸线应该是从圆心到直线的距离,但是他却创建的是圆的边界与直线的距离;
同样的程序,对2D手画的圆和直线,就可以标出圆心到直线的距离。
我想标出3D投影元素(圆和直线)之间的从圆心到直线的距离,但是不能先画出圆心再标,就是说不能再创建新的元素!(这个问题也问过Dassault,他们也解决不了,很有挑战啊!呵呵)
请各位指点一下! 多谢!
其实我觉得开关就是dimDef._Info = ifCenter;这句,但是不知为什么,他对3D投影圆不管用,对2D手画的圆就OK!
程序如下:

CreateDim(IUnknown_var  _circle,IUnknown_var  _line)
{
        // Gets the view annotation factory
        CATIDrwAnnotationFactory_var spAnnFactory = _pView;
   
        // Vertical distance dimension creation between Circle and Line
        CATDrwDimType dimType = DrwDimDistance;
        CATDimDefinition dimDef;
        CATIUnknownList * piSelectionsList =NULL;
        CATIUnknownListImpl * piListsel = new CATIUnknownListImpl();
        piListsel->QueryInterface(IID_CATIUnknownList, (void **) &piSelectionsList);
        piListsel->Release(); piListsel=NULL;

        if (piSelectionsList)
        {
                piSelectionsList->Add(0, _circle);
                piSelectionsList->Add(1, _line);
        }

        double pts[2][2];
        dimDef.Orientation = DrwDimAuto ;
        dimDef._Info = ifCenter;
        if(SUCCEEDED( spAnnFactory->CreateDimension(piSelectionsList,(double**)pts,dimType,&dimDef,&_piDim) ) )
        {
                piSelectionsList->Release();
                piSelectionsList = NULL;
                return true;
        }
        else
        {
                if (piSelectionsList) {piSelectionsList->Release(); piSelectionsList = NULL;}
                return false;
        }
}




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3