Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
I'm trying to write a macro to show sketch of a body using picking, but I'm stucking at getting sketch of oFeature.
I want to show Sketch 2 of Extrusion2 of body P37.
My code will probably be long, if you have shorter code please share.
Thanks in advance.
Option Explicit
Sub ShowSketchBody()
Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument
Dim oObj As Object
Set oObj = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartBodyFilter, "Pick a body:")
Dim oBody1 As SurfaceBody
Set oBody1 = oObj
Dim oBodies As SurfaceBodies
Set oBodies = oDoc.ComponentDefinition.SurfaceBodies
Dim oBody2 As SurfaceBody
Dim oFeature As PartFeature
For Each oBody2 In oBodies
If oBody2.name = oBody1.name Then
For Each oFeature In oBody1.AffectedByFeatures
If oFeature.HealthStatus = kUpToDateHealth Then
' //I'm stucking here, dont know how to get sketch of oFeature//
End If
Next
End If
Next
End Sub
Solved! Go to Solution.