AddForSurface - from existing Extrude

AddForSurface - from existing Extrude

Anonymous
Not applicable
465 Views
4 Replies
Message 1 of 5

AddForSurface - from existing Extrude

Anonymous
Not applicable

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.

0 Likes
466 Views
4 Replies
Replies (4)
Message 2 of 5

adam.nagy
Autodesk Support
Autodesk Support

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,



Adam Nagy
Autodesk Platform Services
0 Likes
Message 3 of 5

Anonymous
Not applicable

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?

0 Likes
Message 4 of 5

adam.nagy
Autodesk Support
Autodesk Support

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


Adam Nagy
Autodesk Platform Services
0 Likes
Message 5 of 5

Anonymous
Not applicable

Thanks a lot.

0 Likes