example extrudes a solid from a region.
' The region is created from a line.
Dim curves(0 To 11) As AcadEntity
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
' Start point
Pt1(0) = 130: Pt1(2) = 170: Pt1(1) = 0#
Pt2(0) = 140: Pt2(2) = 170: Pt2(1) = 0#
Set curves(0) = ThisDrawing.ModelSpace.AddLine(Pt1, Pt2)
' next point
Pt1(0) = 160: Pt1(2) = 210
Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).EndPoint, Pt1)
' next point
Pt1(0) = 160: Pt1(2) = 250
Set curves(2) = ThisDrawing.ModelSpace.AddLine(curves(1).EndPoint, Pt1)
'next point
Pt1(0) = 230: Pt1(2) = 300
Set curves(3) = ThisDrawing.ModelSpace.AddLine(curves(2).EndPoint, Pt1)
' next point
Pt1(0) = 220: Pt1(2) = 320
Set curves(4) = ThisDrawing.ModelSpace.AddLine(curves(3).EndPoint, Pt1)
' next point
Pt1(0) = 80: Pt1(2) = 260
Set curves(5) = ThisDrawing.ModelSpace.AddLine(curves(4).EndPoint, Pt1)
' next point
Pt1(0) = 80: Pt1(2) = 220
Set curves(6) = ThisDrawing.ModelSpace.AddLine(curves(5).EndPoint, Pt1)
'next point
Pt1(0) = 120: Pt1(2) = 220
Set curves(7) = ThisDrawing.ModelSpace.AddLine(curves(6).EndPoint, Pt1)
' next point
Pt1(0) = 120: Pt1(2) = 230
Set curves(8) = ThisDrawing.ModelSpace.AddLine(curves(7).EndPoint, Pt1)
'next point
Pt1(0) = 130: Pt1(2) = 230
Set curves(9) = ThisDrawing.ModelSpace.AddLine(curves(8).EndPoint, Pt1)
' next point
Pt1(0) = 130: Pt1(2) = 170
Set curves(10) = ThisDrawing.ModelSpace.AddLine(curves(9).EndPoint, Pt1)
' next point
Pt1(0) = 140: Pt1(2) = 170
Set curves(11) = ThisDrawing.ModelSpace.AddLine(curves(10).EndPoint, Pt1)
' Create the region
Dim regionObj As Variant
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
' Define the extrusion
Dim height As Double
Dim taperAngle As Double
height = 50
taperAngle = 0
' Create the solid
Set Part1 = ThisDrawing.ModelSpace.AddExtrudedSolid(regionObj(0), height, taperAngle)
'solidObj.color = acBlue
End Sub
Sub AddExtrudedSolid2()
' This code extrudes a solid from a region.
' The region is created from a line.
Dim curves(0 To 11) As AcadEntity
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
' Start point
Pt1(0) = 120: Pt1(1) = 160: Pt1(2) = 0#
Pt2(0) = 200: Pt2(1) = 160: Pt2(2) = 0#
Set curves(0) = ThisDrawing.ModelSpace.AddLine(Pt1, Pt2)
' next point
Pt1(0) = 200: Pt1(1) = 100
Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).EndPoint, Pt1)
' next point
Pt1(0) = 170: Pt1(1) = 110
Set curves(2) = ThisDrawing.ModelSpace.AddLine(curves(1).EndPoint, Pt1)
'next point
Pt1(0) = 140: Pt1(1) = 110
Set curves(3) = ThisDrawing.ModelSpace.AddLine(curves(2).EndPoint, Pt1)
' next point
Pt1(0) = 120: Pt1(1) = 120
Set curves(4) = ThisDrawing.ModelSpace.AddLine(curves(3).EndPoint, Pt1)
' next point
Pt1(0) = 120: Pt1(1) = 160
Set curves(5) = ThisDrawing.ModelSpace.AddLine(curves(4).EndPoint, Pt1)
' next point
Pt1(0) = 200: Pt1(1) = 160
Set curves(6) = ThisDrawing.ModelSpace.AddLine(curves(5).EndPoint, Pt1)
'next point
Pt1(0) = 170: Pt1(1) = 110
Set curves(7) = ThisDrawing.ModelSpace.AddLine(curves(6).EndPoint, Pt1)
' next point
Pt1(0) = 140: Pt1(1) = 110
Set curves(8) = ThisDrawing.ModelSpace.AddLine(curves(7).EndPoint, Pt1)
'next point
Pt1(0) = 120: Pt1(1) = 120
Set curves(9) = ThisDrawing.ModelSpace.AddLine(curves(8).EndPoint, Pt1)
' next point
Pt1(0) = 120: Pt1(1) = 160
Set curves(10) = ThisDrawing.ModelSpace.AddLine(curves(9).EndPoint, Pt1)
' next point
Pt1(0) = 200: Pt1(1) = 160
Set curves(11) = ThisDrawing.ModelSpace.AddLine(curves(10).EndPoint, Pt1)
' Create the region
Dim regionObj As Variant
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
' Define the extrusion
Dim height As Double
Dim taperAngle As Double
height = 40
taperAngle = 0
' Create the solid
Set Part2 = ThisDrawing.ModelSpace.AddExtrudedSolid(regionObj(0), height, taperAngle)
End Sub
Sub AddExtrudedSolid3()
' This code extrudes a solid from a region.
' The region is created from a line.
Dim curves(0 To 9) As AcadEntity
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
' Start point
Pt1(0) = 80: Pt1(2) = 160: Pt1(1) = 0#
Pt2(0) = 0: Pt2(2) = 160: Pt2(1) = 0#
Set curves(0) = ThisDrawing.ModelSpace.AddLine(Pt1, Pt2)
' next point
Pt1(0) = 0: Pt1(2) = 100
Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).EndPoint, Pt1)
' next point
Pt1(0) = 30: Pt1(2) = 110
Set curves(2) = ThisDrawing.ModelSpace.AddLine(curves(1).EndPoint, Pt1)
'next point
Pt1(0) = 60: Pt1(2) = 110
Set curves(3) = ThisDrawing.ModelSpace.AddLine(curves(2).EndPoint, Pt1)
' next point
Pt1(0) = 80: Pt1(2) = 120
Set curves(4) = ThisDrawing.ModelSpace.AddLine(curves(3).EndPoint, Pt1)
' next point
Pt1(0) = 80: Pt1(2) = 160
Set curves(5) = ThisDrawing.ModelSpace.AddLine(curves(4).EndPoint, Pt1)
' next point
Pt1(0) = 0: Pt1(2) = 160
Set curves(6) = ThisDrawing.ModelSpace.AddLine(curves(5).EndPoint, Pt1)
'next point
Pt1(0) = 0: Pt1(2) = 100
Set curves(7) = ThisDrawing.ModelSpace.AddLine(curves(6).EndPoint, Pt1)
' next point
Pt1(0) = 30: Pt1(2) = 110
Set curves(8) = ThisDrawing.ModelSpace.AddLine(curves(7).EndPoint, Pt1)
'next point
' Create the region
Dim regionObj As Variant
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
' Define the extrusion
Dim height As Double
Dim taperAngle As Double
height = 40
taperAngle = 0
' Create the solid
Set Part3 = ThisDrawing.ModelSpace.AddExtrudedSolid(regionObj(0), height, taperAngle)
End Sub
Sub Object()
Dim Blok1_Layer As AcadLayer
Set Blok1_Layer = ThisDrawing.Layers.Add("Blok1")
ThisDrawing.AddSliceBox
ThisDrawing.AddBox2
ThisDrawing.AddBox3
ThisDrawing.AddCylinderRotate
ThisDrawing.AddCylinderRotate2
ThisDrawing.AddCylinderRotate3
ThisDrawing.AddCylinderRotate4
ThisDrawing.AddExtrudedSolid
ThisDrawing.AddExtrudedSolid2
ThisDrawing.AddExtrudedSolid3
boxObj.Boolean acSubtraction, ExtrudedSolid2
boxObj.Boolean acSubtraction, ExtrudedSolid3
boxObj.Boolean acSubtraction, cylinderObj
boxObj.Layer = "Blok1"
Dim Blok2_Layer As AcadLayer
Set Blok2_Layer = ThisDrawing.Layers.Add("Blok2")
box6Obj.Layer = "Blok2"
Dim Blok3_Layer As AcadLayer
ThisDrawing.AddCylinder
End Sub
Висновок
AutoCAD – це наймогутніший і найвикористовуваний пакет проектувальниками. Така програма розвиватиметься і далі, переслідуючи цілі по полегшенню роботи в ньому. Мені доводилося працювати в трьох версіях цього пакету. Це були AutoCAD R10, AutoCAD 2000i і AutoCAD 2002. Якщо різниця між останніми двома версіями маловідчутна, то переваги AutoCAD 2xxx перед R10 видно відразу.
По-перше ця більша кількість ліній, штрихувань і т.д. По-друге це відмова від Dos-ядра, використовуваного також в Windows 95,98,2000. Тепер ACAD більше нагадує графічні пакети (особливо 2004 версія ). Там можна вставляти, вирізати і використовувати векторні об'єкти для редагування в програмі. Звичайно є і інші пакети проектування такі як ArhiCAD, MathCAD, і взагалі всі CAD’и, але на сьогоднішній момент AutoCAD найкраща і продумана програма промислового проектування.
Список використаних джерел
Методичні вказівки “Двовимірне креслення в AutoCAD 2000” для студентів усіх форм навчання / Укл.: О.В. Бабков – К.: НТУ, 2004. – 108 с.
Методичні вказівки “Тривимірне моделювання в AutoCAD 2000” для студентів усіх форм навчання / Укл.: О.В. Бабков – К.: НТУ, 2004. – 82 с.
Концевич В.Г. Трехмерное моделирование в AutoCAD 59 с.
Погорелов В. И. AutoCAD 2005 для начинающих. — СПб.: БХВ-
Петербург, 2004. —400 с.
8. “Autocad 2000. Практический курс.” А. Федоренко, К. Басов, А. Акимов
Додатки
Рис.a. Рендеринг ізометричного вигляду фігури
Рис.b. Три проекції вигляду фігури