Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AddForSurface - from existing Extrude

4 REPLIES 4
Reply
Message 1 of 5
kulkary
283 Views, 4 Replies

AddForSurface - from existing Extrude

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.

Tags (1)
4 REPLIES 4
Message 2 of 5
adam.nagy
in reply to: kulkary

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
Message 3 of 5
kulkary
in reply to: adam.nagy

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?

Message 4 of 5
adam.nagy
in reply to: kulkary

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
Message 5 of 5
kulkary
in reply to: adam.nagy

Thanks a lot.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report