ViStruct: Visual Structural Knowledge Extraction via Curriculum Guided Code-Vision Representation