Showing results for 
Search instead for 
Did you mean: 

Problem Extruding Surfaces with AddFinite method


Hi there.


I have searched along, but I have not found many info regarding surface extrusion.


Basically, I need to extrude a surface using an existing sketch in order to check different stuff from that sketch. This is more or less the code, where oSketchToExtrude is my sketch and oSheet the sheet document (I'm using this mostly on sheet documents):



'Store here the single Profile to extrude
Dim oProfileArray As Array = Array.CreateInstance(GetType(SolidEdgePart.Profile), 1) oProfileArray.SetValue(oSketchToExtrude.Profile, 0)

'This works oSheet.Constructions.ExtrudedSurfaces.AddFinite(1, oProfileArray, SolidEdgePart.FeaturePropertyConstants.igRight, 0.001, False) 'This doesn't work oSheet.Constructions.ExtrudedSurfaces.AddFinite(1, oProfileArray, SolidEdgePart.FeaturePropertyConstants.igSymmetric, 0.001, False) 'This also doesn't work oSheet.Constructions.ExtrudedSurfaces.AddFinite(1, oProfileArray, SolidEdgePart.FeaturePropertyConstants.igRight, 0.001, True)


If I extrude the surface without caps (last argument is False), the command works, but as soon as I choose to use caps, it fails, and the operation shows a red alert on Pathfinder, with no surface being generated. If I manually extrude a surface using all the sketch lines and using caps, the command works with no issues, so the sketch is fine for that.


The same happens if I decide to use a symmetric extrussion. It manually works, but doing the same from the API agains generate a red alert.


I'm using a sketch like this for my tests, a simple rectangle with two circles inside it:




I have tried to manually edit the wrong-API surface extrusion, in order to inspect the problem, and the only weird thing I have noticed is that rectangle and circles seem connected with some edges inside the operation, instead of the circles being treated in an isolated way. In any case, SE fails when trying to generate the caps for this form the API.


If I use that same shape to extrude a solid with the API, I get no issues and SE can guess the needed caps without any problem. I use similar sintaxis for ExtrudedProtusions.AddFinite (except for the caps flag, which doesn't exist there) with success.


I'm not sure if I'm passing the Profile info the correct way by means of the Array object, but Visual Studio doesn't allow me much more options with my settings and, as I said, that works fine when extruding solid protusions.


So, any clue about extruding surfaces with caps from the API??


Much thanks in advance for your time and interest!