Creates a line passing through two points.
Dim pt1 As Variant
pt1 = ThisDrawing.Utility.getPoint(,"點1")
Dim pt2 As Variant
pt2 = ThisDrawing.Utility.getPoint(,"點2")
Dim lineObj As AcadLine
Set lineObj = ThisDrawing.ModelSpace.AddLine(pt1, pt2)
Creates an arc given the center, radius, start angle, and end angle of the arc.
Dim centerPnt As Variant
centerPnt = ThisDrawing.Utility.getPoint(,"指定弧的中心點:")
Dim radius As Double
radius = ThisDrawing.Utility.getReal("指定弧的半徑:")
Dim Ang10 As Double
Dim Ang230 As Double
Ang10 = aUt.AngleToReal(10, acDegrees)
Ang230 = aUt.AngleToReal(230, acDegrees)
Dim arcObj As AcadArc
Set arcObj = ThisDrawing.ModelSpace.addArc(centerPnt, radius, Ang10, Ang230)
Creates a circle given a center point and radius.
Dim centerPnt As Variant
centerPnt = ThisDrawing.Utility.getPoint(,"指定圓的中心點:")
Dim radius As Double
radius = ThisDrawing.Utility.getReal("指定圓的半徑:")
Dim circleObj As AcadCircle
Set circleObj = ThisDrawing.ModelSpace.addCircle(centerPnt, radius)
Creates an ellipse in the XY plane of the WCS given the center point, a point on the major axis, and the radius ratio.
Dim centerPnt As Variant
centerPnt = ThisDrawing.Utility.getPoint(,"指定橢圓的中心點:")
Dim majAxis(0 To 2) As Double
majAxis(0) = 10
majAxis(1) = 20#
majAxis(2) = 0#
Dim radRatio As Double
radRatio = 0.3
Dim ellObj As AcadEllipse
Set ellObj = ThisDrawing.ModelSpace.AddEllipse(centerPnt, majAxis, radRatio)
Creates a lightweight polyline from a list of vertices.
Dim points(0 To 7) As Double
points(0) = 0: points(1) = 0
points(2) = 5: points(3) = 0
points(4) = 5: points(5) = 8
points(6) = 0: points(7) = 8
Dim plineObj As AcadLWPolyline
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
plineObj.Closed = True
'plineObj.SetBulge 0, 1
'plineObj.SetBulge 2, 1