Select sketch of a CutFeatureProxy

Select sketch of a CutFeatureProxy

Anonymous
Not applicable
267 Views
2 Replies
Message 1 of 3

Select sketch of a CutFeatureProxy

Anonymous
Not applicable
i'm trying to get the sketch of a CutFeatureProxy, but I get lost.

Dim oFeature As Inventor.PartFeature
Set oFeature = oFace.CreatedByFeature
Dim oCutFeature As Inventor.CutFeatureProxy
Set oCutFeature = oFeature
Dim oSketch As Inventor.Sketch
Set oSketch = oCutFeature.???????

Geert
0 Likes
268 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
The API doesn't yet support full query of sheet metal features, so this is
not currently possible. This is very high on our priorities for the next
release.

Until then, you can use the following workaround. It uses the browser APIs
to find the child sketch node (and hence the sketch) of the cut feature.

Sanjay-

Sub GetFeatureSketch()

Dim oDoc As PartDocument
Set oDoc = ThisApplication.ActiveDocument

Dim oFeat As PartFeature
Set oFeat = oDoc.SelectSet(1)

' Get the browser node definition of the feature
Dim oBND As NativeBrowserNodeDefinition
Set oBND = oDoc.BrowserPanes.GetNativeBrowserNodeDefinition(oFeat)

' Get the browser nodes that use this definition
' (should be just 1 in this case)
Dim oBN As BrowserNode
Set oBN =
oDoc.BrowserPanes.ActivePane.TopNode.AllReferencedNodes(oBND).Item(1)

' Get the first child of the feature browser node
Dim oSketchBN As BrowserNode
Set oSketchBN = oBN.BrowserNodes.Item(1)

Dim oSketch As Sketch
Set oSketch = oSketchBN.BrowserNodeDefinition.NativeObject

End Sub
0 Likes
Message 3 of 3

Anonymous
Not applicable
on this workaround I didn't think of at all, but it works for me fine.

Thanks,
Geert
0 Likes