Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to render my entity differently depending on the current visual style selected. I am trying to get the current visual style for the subEntityTraits of the drawing context but the call is returning a null object id. Any ideas?
Adesk::Boolean TPG_Drawable::Draw(AcArray<TPG_Entity*>& ents, AcGiWorldDraw* dc, int options, bool cacheExtents)
{
auto styleId = dc->subEntityTraits().visualStyle();
AcRxObject* rxObj = nullptr;
if (acdbOpenObject(rxObj, styleId, AcDb::kForRead) == Acad::eOk)
{
auto style = static_cast<AcGiVisualStyle*>(rxObj);
switch (style->type())
{
case AcGiVisualStyle::Type::k2DWireframe:
break;
case AcGiVisualStyle::Type::k3DWireframe:
{
auto rep = GetRepresentation3D();
rep->worldDraw(dc);
}
return Adesk::kTrue;
case AcGiVisualStyle::Type::kRealistic:
break;
}
}
return Adesk::kTrue;
}Mike
Solved! Go to Solution.