this should not be necessary, since vertex maps are being automatically resized to match the point count of their hosting object. Could you provide some code or an example on where you did encounter a different behavior? Below you will find a script, that shows you how to access the high level data of a vertex map.
import c4d def main(): """ """ # Ensure that the current selection is a polygon object. if not isinstance(op, c4d.PolygonObject): return # Get the first vertex map of the object. vertextmaps = [tag for tag in op.GetTags() if tag.CheckType(c4d.Tvertexmap)] if not vertextmaps: return vmap = vertextmaps # Vertex maps are instances of c4d.VariableTag. VariableTag.GetDataCount() # returns the number of data elements of the instance, e.g. the number of # weights for a vertex map. print "vertex map data count before subdivision:", vmap.GetDataCount() # Subdivide the object once bc = c4d.BaseContainer() bc[c4d.MDATA_SUBDIVIDE_SUB] = 1 res = c4d.utils.SendModelingCommand( command=c4d.MCOMMAND_SUBDIVIDE, list=[op], mode=c4d.MODELINGCOMMANDMODE_POLYGONSELECTION, bc=bc, doc=doc) # The vertex map has been automatically resized. print "vertex map data count after subdivision:", vmap.GetDataCount() # A list of weights with the length of the size of the vertex map, where # even IDs (i.e. the point IDs of the polygon object) are a weight of 1 # and odd elements are a weight of 0. weights = [float(n % 2 == 0) for n in range(vmap.GetDataCount())] # Write the new weight data into our vertex map. vmap.SetAllHighlevelData(weights) # Update Cinema c4d.EventAdd() # Execute main() if __name__ == '__main__': main()