Product : Engine, Version : 5.1.1.1041, ArticleID : 41024252

HowTo : How can I get the individual Items in a Polyhatch

Article41024252
TypeHowTo
ProductEngine
Version5.1.1.1041
Date Added6/23/2006
Submitted byAditya Shaw
Keywords

Subject

How can I get the individual Items in a Polyhatch

Summary

Can I get the individual Items in a Polyhatch of a drawing file after I define a Polyhatch and save it in a drawing file? It will be kind of you if you can please provide some sample code.

Solution

Try a code (VB 6) like :
Dim phNew As vdPolyhatch
Set phNew = VDPro1.ActiveDocument.GetFromHandle(PolyHatchHandle) 'get the polyhatch from handle
Dim poly As vdPolyline
Dim i As Integer
i = 1
For Each poly In phNew
    VDPro1.ActiveDocument.Entities.AddItem poly
    poly.PenColor.ColorIndex = i
    i = i + 1
    poly.Invalidate
Next poly