iT邦幫忙

0

AutoCAD ActiveX #3 Draw

joor 2021-05-20 17:50:521084 瀏覽
  • 分享至 

  • xImage
  •  

AddLine

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)

AddArc

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)

AddCircle

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) 

AddEllipse

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)

Polyline

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

上一篇
下一篇


圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言