Exemplo n.º 1
0
void HSolidModel::DeleteAcisEntity( ENTITY* entity)
{
	ENTITY_LIST elist;
	elist.add(entity);
	HA_Delete_Entity_Geometry(elist);
	// delete the ACIS body
	api_del_entity(entity);
	m_entityList.remove(entity);
}
void PmeStdSolidChamferFeature::Update(void)
{
	PmeThrowExceptionIf<PmeIlligalOperationException>(GetChamferType() != PmeChamferType_Length);
	
	PmeThrowExceptionIf<PmeIlligalOperationException>(m_pSelectedEdge == 0);
	
	PmeThrowExceptionIf<PmeIlligalOperationException>(m_length != m_value);
	PmeThrowExceptionIf<PmeIlligalOperationException>(m_length <= 0);
	PmeThrowExceptionIf<PmeIlligalOperationException>(m_value <= 0);
	
	PmeThrowExceptionIf<PmeIlligalOperationException>(GetSelectedEdge()->GetReferenceType() != PmeReferenceType_Brep);

	PmePart * pPart = GetPart();
	ENTITY * pEdge = pPart->GetSelectionManager()->GetBrepFromReference(GetSelectedEdge());

	PmeThrowExceptionIf<PmeIlligalOperationException>(strcmp(pEdge->type_name(), "edge") != 0);

	ENTITY_LIST selectedEdges;
    selectedEdges.add(pEdge);

	double leftRange = m_length;
	
	API_BEGIN

		// api_set_int_option("annotations", TRUE);

		result = api_chamfer_edges(selectedEdges, leftRange);
		check_outcome(result);
	
		if(result.ok())
		{
			PmeSolid * pSolid = pPart->GetExplicitModel()->GetSolid();
			SetSolid(pSolid);
		}

		// api_clear_annotations();

	API_END		
}