Функция вытянуть по сечениям

Автор Тема: Функция вытянуть по сечениям  (Прочитано 4347 раз)

0 Пользователей и 1 Гость просматривают эту тему.

Оффлайн Алексей123456789Автор темы

  • ADN OPEN
  • Сообщений: 30
  • Карма: 0
Подскажите, пожалуйста функцию " Вытянуть по сечениям"

Отмечено как Решение Алексей123456789 25-03-2016, 23:04:56

Оффлайн mikazakov

  • ADN
  • *
  • Сообщений: 752
  • Карма: 195
  • Skype: mikazakov@mail.ru
Re: Функция вытянуть по сечениям
« Ответ #1 : 25-03-2016, 08:03:19 »
Подскажите, пожалуйста функцию " Вытянуть по сечениям"
В хелпе поищите LoftFeatures
Я бы не рекомендовал бы с этой вещью связываться ради диплома.

там же и пример:
Код - Visual Basic [Выбрать]
  1. Public Sub CreateNonPlanarSectionLoft()
  2.     ' Create a new part document, using the default part template.
  3.    Dim oPartDoc As PartDocument
  4.     Set oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, _
  5.                 ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject))
  6.  
  7.     Dim oCompDef As PartComponentDefinition
  8.     Set oCompDef = oPartDoc.ComponentDefinition
  9.  
  10.     Dim oTG As TransientGeometry
  11.     Set oTG = ThisApplication.TransientGeometry
  12.  
  13.     ' Create a 2d sketch to use as one section.
  14.    Dim oSketch As PlanarSketch
  15.     Set oSketch = oCompDef.Sketches.Add(oCompDef.WorkPlanes.Item(3))
  16.     Call oSketch.SketchCircles.AddByCenterRadius(oTG.CreatePoint2d(0, 0), 5)
  17.  
  18.     ' Create the profile to use as the section.
  19.    Dim oProfile1 As Profile
  20.     Set oProfile1 = oSketch.Profiles.AddForSolid
  21.  
  22.     ' Create a 3d sketch to use as the second section.
  23.    Dim oSketch3d As Sketch3D
  24.     Set oSketch3d = oCompDef.Sketches3D.Add
  25.  
  26.     Dim oWPs(1 To 6) As WorkPoint
  27.     Set oWPs(1) = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(-8, 6, 10))
  28.     Set oWPs(2) = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(-8, -6, 10))
  29.     Set oWPs(3) = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(0, -4, 8))
  30.     Set oWPs(4) = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(8, -6, 10))
  31.     Set oWPs(5) = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(8, 6, 10))
  32.     Set oWPs(6) = oCompDef.WorkPoints.AddFixed(oTG.CreatePoint(0, 4, 8))
  33.     Dim oStartLine3d As SketchLine3D
  34.     Set oStartLine3d = oSketch3d.SketchLines3D.AddByTwoPoints(oWPs(1), oWPs(2), True, 2)
  35.     Dim oLine3d As SketchLine3D
  36.     Set oLine3d = oSketch3d.SketchLines3D.AddByTwoPoints(oStartLine3d.EndSketchPoint, oWPs(3), True, 2)
  37.     Set oLine3d = oSketch3d.SketchLines3D.AddByTwoPoints(oLine3d.EndSketchPoint, oWPs(4), True, 2)
  38.     Set oLine3d = oSketch3d.SketchLines3D.AddByTwoPoints(oLine3d.EndSketchPoint, oWPs(5), True, 2)
  39.     Set oLine3d = oSketch3d.SketchLines3D.AddByTwoPoints(oLine3d.EndSketchPoint, oWPs(6), True, 2)
  40.     Set oLine3d = oSketch3d.SketchLines3D.AddByTwoPoints(oLine3d.EndSketchPoint, oStartLine3d.StartSketchPoint, True, 2)
  41.  
  42.     ' Create a 3d profile to use as the section. Even though this section
  43.    ' is closed the AddOpen method must be used because it is non-planar.
  44.    Dim oProfile2 As Profile3D
  45.     Set oProfile2 = oSketch3d.Profiles3D.AddOpen
  46.  
  47.     ' Create an object collection for the sections.
  48.    Dim oSections As ObjectCollection
  49.     Set oSections = ThisApplication.TransientObjects.CreateObjectCollection
  50.     Call oSections.Add(oProfile1)
  51.     Call oSections.Add(oProfile2)
  52.  
  53.     ' Create the loft definition. Because one of the ends isn't planar,
  54.    ' a surface must be created instead of a solid.
  55.    Dim oLoftDefinition As LoftDefinition
  56.     Set oLoftDefinition = oCompDef.Features.LoftFeatures.CreateLoftDefinition(oSections, kSurfaceOperation)
  57.  
  58.     ' Create the loft feature.
  59.    Call oCompDef.Features.LoftFeatures.Add(oLoftDefinition)
  60. End Sub
  61.  

Оффлайн Алексей123456789Автор темы

  • ADN OPEN
  • Сообщений: 30
  • Карма: 0
Re: Функция вытянуть по сечениям
« Ответ #2 : 25-03-2016, 23:04:51 »
Благодарю!