选取两条相交直线进行圆弧fillet。虽然mdl函数返回SUCCESS但是却没有生成元素。我使用fillet构建一个EditElementHandle 但却是invalid?
virtual bool _OnModifyComplete(DgnButtonEventCR ev) override { if (m_hitPoints.size() == 2) { ElementAgendaR agenda = GetElementAgenda(); DPoint3d mid_point = DPoint3d::FromWeightedAverage(m_hitPoints.front(), 1, m_hitPoints.back(), 1); MSElementP fillet = NULL; StatusInt status = mdlElmdscr_fillet(fillet, NULL, agenda.GetEntryP(0)->GetElementDescrP(), agenda.GetEntryP(1)->GetElementDescrP(), roadparams.roadturn_radius, &mid_point, NULL); wprintf(L">>> entered elementmodified function, there are %d number of line elements in the element agenda \n", GetElementAgenda().size()); wprintf(L">>> is success: %s, the fillet %s \n", status == SUCCESS ? L"true" : L"false", fillet==NULL? L"is not null":L" is null"); if (status == SUCCESS) { EditElementHandle eh(fillet, agenda.GetEntryP(0)->GetDgnModelP()); if(eh.IsValid()) eh.AddToModel(); } m_hitPoints.clear(); } return __super::_OnModifyComplete(ev); }
MSElement fillet; StatusInt status = mdlElmdscr_fillet(&fillet, NULL,
第一个参数要像上边这样传递。