''' <summary>
''' Создание чертежа конуса (g_inventorApplication - доступ к инвентору)
''' </summary>
''' <param name="oPartDoc">
''' модель конуса
''' </param>
''' <param name="oDrawingDoc">
''' документ чертежа в котором надо создать вид
''' </param>
Public Sub DrewingConicalShell(oPartDoc As Inventor.PartDocument, oDrawingDoc As Inventor.DrawingDocument)
Dim oSheet As Sheet
Dim oView As DrawingView
Dim scale As Double
Dim oSketch As Sketch
Dim oTG As TransientGeometry
oTG = g_inventorApplication.TransientGeometry
oSheet = oDrawingDoc.Sheets.Item(1)
'поворо камеры на 15 градусов по оси Х
Dim cam As Camera
cam = g_inventorApplication.TransientObjects.CreateCamera
cam.SceneObject = oPartDoc.ComponentDefinition
Dim x As Double
Dim y As Double
x = Math.Cos(Math.PI / 12)
y = Math.Sin(Math.PI / 12)
cam.Eye = oTG.CreatePoint(0, x, y)
cam.Target = oTG.CreatePoint(0, -x, -y)
cam.UpVector = oTG.CreateUnitVector(0, 0, -1)
cam.ApplyWithoutTransition()
'Создание вида на чертеже с повернутой камеры
oView = oSheet.DrawingViews.AddBaseView(oPartDoc, oTG.CreatePoint2d(14.8, 10.5), 1 / 5, ViewOrientationTypeEnum.kArbitraryViewOrientation, DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle,, cam)
'Cоздание вида спереди на чертеже
'oView = oSheet.DrawingViews.AddBaseView(oPartDoc, oTG.CreatePoint2d(14.8, 10.5), 1 / 5, ViewOrientationTypeEnum.kFrontViewOrientation, DrawingViewStyleEnum.kHiddenLineRemovedDrawingViewStyle)
' Создание профиля для местного разреза
oSketch = oView.Sketches.Add
oSketch.Edit()
Call oSketch.SketchLines.AddAsTwoPointCenteredRectangle(oTG.CreatePoint2d(0, 0), oTG.CreatePoint2d((oView.Width / oView.Scale / 2) + 1, (oView.Height / oView.Scale / 2) + 1))
oSketch.ExitEdit()
Dim oProfile As Profile
oProfile = oSketch.Profiles.AddForSolid
'выбор кривой для назначения глубины местного разреза
Dim oDCurve As DrawingCurve
oDCurve = oView.DrawingCurves.Item(1)
Dim oColor As Inventor.Color
oColor = g_inventorApplication.TransientObjects.CreateColor(0, 0, 255) 'Синий
oDCurve.Color = oColor
Dim oPointIntent As Point2d
oPointIntent = oDCurve.StartPoint
Dim oIntent1 As GeometryIntent
oIntent1 = oSheet.CreateGeometryIntent(oDCurve, oPointIntent)
'создание местного разреза
Call oView.BreakOutOperations.Add(oProfile, oIntent1, 0)
End Sub