I have the following task to achieve:
1. I start with sketch with many sketch regions.
2. I extrude some of the regions with a loop through all sketch regions.
3. I loop through the regions again and build surface lofts above sketch regions that are in between extrudes from step 2, connecting the upper extrude edges.
4. I surface extend the surfaces from step 3.
5. I extrude the in between sketch regions up to the surfaces from step 4.
I have a problem looping through the sketch regions after I create the surface in step 3.
This is the loop :
For i = LBound(vSkRegions) To UBound(vSkRegions) Set skRegion = vSkRegions(i)
The reference to the vSkRegions gets broken after I do the surface in the step 3.
I can't find the reason why this happens. Here are some functions I suspect are the cause:
swModel.ClearSelection2 (True) swModel.InsertLoftRefSurface2 False, False, False, 1, 2, 2 Set swFeature = swFeatureMgr.GetFeatures(True)(swFeatureMgr.GetFeatureCount(True) - 1) myLoftSurEdges = mySurBody.GetEdges() swModel.InsertExtendSurface False, 0, 0.001
Here are the pictures of what I have to do: