Message 1 of 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
This is always giving me a parameter incorrect error.
I tried adding different things to the collection (sketchlines, sketchentities, ...SketchLines.item(1), ....)
But always the parameter incorrect.
Sub main()
Dim oDrawingDocument As DrawingDocument = ThisDoc.Document
Dim oSheet As Sheet = oDrawingDocument.ActiveSheet
Dim oView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Pick view where the sections shoud be made")
If oView Is Nothing Then Exit Sub
Dim ClArray As New ArrayList
KeepAdding:
Dim oSelectCenterline As Centerline = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingCenterlineFilter, "Pick the centerlines where a section shoud be made")
If Not oSelectCenterline Is Nothing Then
ClArray.Add(oSelectCenterline)
GoTo KeepAdding
End If
For Each oCenterLine As Centerline In ClArray
Dim oSketch As DrawingSketch
Dim oObjCol As ObjectCollection
oObjCol = ThisApplication.TransientObjects.CreateObjectCollection
oSketch = oView.Sketches.Add
Dim oSketchEntity As SketchEntity = oSketch.AddByProjectingEntity(oCenterLine)
oObjCol.Add(oSketchEntity)
oSketch.OffsetSketchEntitiesUsingDistance(oObjCol, 150, True, False, False)
'Create section on this sketch
'oSheet.DrawingViews.AddSectionView(oView, oSketch, oPoint, DrawingViewStyleEnum.kFromBaseDrawingViewStyle, 1 / 100, True, oLabelName, , False, 300)
Next
End Sub
Solved! Go to Solution.