this is from my last script that seemed to be working but i ran into a model with a face in +z and in -z.
Im not really sure if what im trying to do here is right at all.
this is run on a few footprint polygons facing +z. i want this to select them all and reverse them and if there are polys already facing -z, leave them alone
i was thinking the k == 1 meant the polys that are facing +z would be selected and reversed
John
this is from my last script that seemed to be working but i ran into a model with a face in +z and in -z.
Im not really sure if what im trying to do here is right at all.
this is run on a few footprint polygons facing +z. i want this to select them all and reverse them and if there are polys already facing -z, leave them alone
i was thinking the k == 1 meant the polys that are facing +z would be selected and reversed
def findHiddenPolys ( db, parent, rec , counter):
type = mgGetCode (rec)
if ( type == fltPolygon ):
outs = mgGetAttList (rec, fltPolyHidden)
if (outs[2] == 1):
counter.match_list.append (rec)
counter.count = counter.count + 1
mgDeselectAll(db)
for rec in counter.match_list:
b,i,j,k = mgGetPolyNormal(rec)
if k == 1:
mgSelectOne(rec)
mgExecute("Reverse Face",None)
return MG_TRUE
return MG_TRUE
mgWalk(db,findHiddenPolys, None, counter, MWALK_NEXT)