- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am using the api to create a drawing of an assembly which has a part in it that is only a sketch (kind of a semi-skeleton sketch). I am trying to show this sketch in the drawing and then change the linetype of the lines of the sketch. I have been able to show the sketch using the "SetVisibility" method, but I cannot find a good way to find the sketch curves to change their linetype. The only way I have found is by adding all the curves to an object collection initially and then after using SetVisibility to show the sketch I iterate through those curves again and change the linetype of any curves that are not in the object collection created previously. This is very slow. Can anybody out there tell me a faster way to find these curves? Here is some of the code I am using:
Dim elemSketch As PlanarSketch = wdDef.Sketches.Item(2)
Dim wdColl As ObjectCollection = oInventorApp.TransientObjects.CreateObjectCollection For Each dc As DrawingCurve In oMainView.DrawingCurves wdColl.Add(dc) Next oMainView.SetVisibility(elemSketch, True) For Each dc As DrawingCurve In oMainView.DrawingCurves For count = 1 To wdColl.Count If wdColl(count) Is dc Then GoTo A1 End If Next dc.LineType = LineTypeEnum.kDashedHiddenLineType dc.LineWeight = 0.1 A1: Next
Solved! Go to Solution.