I have an Extrude, say of the shape of a Solid Block. Sketch Profile has 4 lines, making a rectangle.
I with to share that sketch. Create and Add a new profile to it via AddForSurface. The new profile should have same (or copy of) 4 lines.
This will create ExtrusionSrf with Open box like shape.
I am unable to copy existing sketch geeomtrical entites (SketchEntities seem to more than just geomtry), pass to AddForSurface. Errors.
Hi,
"(or copy of)" - how do you copy the lines?
If they are OK where they are then I would think you don't have to copy them, it should be enough that the sketch is shared in order to be able to use it again.
Cheers,
I wish to gather just the geometrical entities (and not others like, dimensions, constraints etc) to pass to AddForSurface...I can always go to SketchLines, SketchCurves etc...but is there any generic call that will fetch all the sketch geometries?
You can use the SketchEntities collection, but ignore Construction lines and points:
Sub GetSketchEntities() ' Go inside the sketch you are interested in ' before running the code Dim sk As PlanarSketch Set sk = ThisApplication.ActiveEditObject ' Construction lines or points cannot be used for ' extrusion, so eliminate them Dim counter As Integer Dim se As SketchEntity For Each se In sk.SketchEntities If Not (se.Construction Or TypeOf se Is SketchPoint) Then counter = counter + 1 End If Next MsgBox ("Number of sketch geometry = " + str(counter)) End Sub