ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

getSplitCurves Fails with AcDb2dPolyline of polyType k2dCubicSplinePoly

3 REPLIES 3
Reply
Message 1 of 4
421232206
449 Views, 3 Replies

getSplitCurves Fails with AcDb2dPolyline of polyType k2dCubicSplinePoly

 this should be a bug of Acdb2dPolyline.

 First you select an AcdbPolyline of k2dCubicSplinePoly,

the code below shows where the crush happens.

 

        AcDbObjectPointer<AcDbCurve> pCurve(idPL,AcDb::kForRead);
        AcGePoint3d pt3dOncurve;
        pCurve->getClosestPointTo(asPnt3d(pt),pt3dOncurve);
        double dParam = -1;
        Acad::ErrorStatus es = pCurve->getParamAtPoint(pt3dOncurve,dParam);
        acutPrintf(_T("\n%d,%g,%g,%g"),es,dParam,pt3dOncurve.x,pt3dOncurve.y);
        
        es = pCurve->getPointAtParam(dParam,pt3dOncurve); // here ,dParam usualy much bigger than the number of vertices.
        acutPrintf(_T("\n%d,%g,%g,%g"),es,dParam,pt3dOncurve.x,pt3dOncurve.y);
    
        AcGeDoubleArray dBulgeArr;
        dBulgeArr.append(dParam);
        AcDbVoidPtrArray curveSegments;
        AcGePoint3dArray pt3dNodes;
        pt3dNodes.append(pt3dOncurve);
        //es = pCurve->getSplitCurves(dBulgeArr,curveSegments);
        es = pCurve->getSplitCurves(pt3dNodes,curveSegments);// here crushes. but with a simple Acdb2dPolyline, the codes works very well.
        {
            int i=0;
            for (;i<curveSegments.length();++i)
            {
                AcDbCurve* pNewCurve = (AcDbCurve*)curveSegments[i];
                AcDbObjectId idNew;
                if (Acad_Ent::AppendEntity(pNewCurve,idNew))
                {
                    pNewCurve->close();
                }
            }
        }

Technology change world! Coding change technology! We coders are coding!
3 REPLIES 3
Message 2 of 4

AutoCAD version? ObjectARX version? x86/x64?

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 4

sorry, I forgot that.


The CAD version is 2008, and OjbectARX is also 2008.

Technology change world! Coding change technology! We coders are coding!
Message 4 of 4
421232206
in reply to: 421232206

I guess this should be a bug, and autodesk would not like to fix it in Version such as 2008,2009.  if so ,I have to change my code.

Technology change world! Coding change technology! We coders are coding!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost