I'm creating a Line or Ellipse Element that I need to symbolize. The Ellipse symbolization also includes an AreaFill:
if ( lineElementDesired) { if (SUCCESS != LineHandler::CreateLineElement(eeh, NULL, segment, ACTIVEMODEL->Is3d(), *ACTIVEMODEL)) { ... } } else { if (SUCCESS != EllipseHandler::CreateEllipseElement(eeh, NULL, dot, ACTIVEMODEL->Is3d(), *ACTIVEMODEL)) { ... } } // element is cvreated - now symbolize ElementPropertiesSetterPtr remapper = ElementPropertiesSetter::Create(); remapper->SetLevel(m_levelID); remapper->SetColor(3); remapper->SetWeight(0); // solid fill remapper->SetLinestyle(0, NULL); remapper->SetDisplayPriority(2); remapper->Apply(eeh); // get the AreaFillPropertiesEdit for the element IAreaFillPropertiesEditP editProps = dynamic_cast<IAreaFillPropertiesEditP>(&eeh.GetHandler()); if (editProps) { // Crash here when element is a LINE_ELM - why is editProps not NULL? }
Shouldn't:
editProps = dynamic_cast<IAreaFillPropertiesEditP>(&eeh.GetHandler());
return a NULL 'editProps'? What AreaFillProperties are there on a LINE_ELM?
Oops - I found the cause of the crash. It was not related to IAreaFillPropertiesEdit. I seem to be unable to delete this post...
Answer Verified By: Bruce Reeves SRNS
Bruce Reeves SRNS said:I seem to be unable to delete this post...
I am not sure what "Cancel" button under the original post does. I see it only in posts I am author, so maybe it's the way?
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point