Message 1 of 2

Not applicable
04-10-2017
02:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
when i select a nested part in the modelbrowser and try to get it's drawingcurves my routine gets a error: "The parameter is incorrect" on
oCurveEnum = oDrawView.DrawingCurves(oNativeObj)
Why is that?
When i select a part direct under the main assembly all works fine, but when i select a part under a subassembly i get the error.
Kind Regards,
Geert
Inventor Pro 2017
Private Function GetAllDrawingCurvesOfSelectedBrowserNodes(ByVal oStartBrowserNode As Inventor.BrowserNode, ByVal oObjectCollection As Inventor.ObjectCollection) As Inventor.ObjectCollection Dim oINVDrawingDoc As Inventor.DrawingDocument = m_inventorApplication.ActiveDocument Dim oSheet As Inventor.Sheet = oINVDrawingDoc.ActiveSheet For Each oBrowserNode As Inventor.BrowserNode In oStartBrowserNode.BrowserNodes Try Dim oNativeObj As Object oNativeObj = oBrowserNode.NativeObject If TypeName(oNativeObj) = "ComponentOccurrence" Then If oBrowserNode.Selected = True Then 'Dim oCompOcc As Inventor.ComponentOccurrence = oNativeObj Try For Each oDrawView As Inventor.DrawingView In oSheet.DrawingViews 'check of drawingView is shaded, dan overslaan If oDrawView.ViewStyle <> Inventor.DrawingViewStyleEnum.kShadedDrawingViewStyle Then Dim oCurveEnum As Inventor.DrawingCurvesEnumerator Try oCurveEnum = oDrawView.DrawingCurves(oNativeObj) 'oCompOcc Dim oCurve As Inventor.DrawingCurve Dim oSegment As Inventor.DrawingCurveSegment 'add segments to collection to be moved to required layer For Each oCurve In oCurveEnum For Each oSegment In oCurve.Segments Call oObjectCollection.Add(oSegment) Next Next Catch ex As Exception End Try End If Next Catch ex As Exception End Try Else 'check SubBrowserNodes Call GetAllDrawingCurvesOfSelectedBrowserNodes(oBrowserNode, oObjectCollection) End If End If Catch ex As Exception End Try Next Return oObjectCollection End Function
Solved! Go to Solution.