70000274 ToMesh method to apply HatchProperties Material to returned Polyface

Article 70000274
Type Wish
Product Engine
Version 7002
Date Added 1/29/2015
Fixed (1/30/2015)
Submitted by Vdraw team

Summary

ToMesh method was improved in order to apply HatchProperties Material to returned Polyface's Pencolor.

Solution

In version 7003.0.6 the ToMesh() method was improved and it detects the hatchImage property of the vdPolyHatch or vdCurve, then adds it as material image to the created vdPolyface object. Keeping the same visual result.

Example of use C#

vdEntities ents = doc.Model.Entities;
int count = ents.Count;
for (int i = 0; i < count; i++)
{
   vdFigure fig = ents[i];
   vdPolyface pf = null;
   if (fig is vdPolyhatch)
   {
      pf = ((vdPolyhatch)fig).ToMesh(0);
   }
   else if (fig is vdCurve)
   {   
      pf = ((vdCurve)fig).ToMesh(0);
   }
   if (pf == null) continue;

   ents.AddItem(pf);
   ents.swap(fig, pf);

   fig.Deleted = true;
   ents.RemoveLast();
}
doc.Redraw(true);

Send comments on this topic.