UG爱好者

标题: NX-snap [打印本页]

作者: 欧阳天痕    时间: 2019-11-21 19:03
标题: NX-snap
本帖最后由 欧阳天痕 于 2019-11-21 19:09 编辑
  1. Imports Snap, Snap.Create

  2. Partial Public Class MyProgram

  3.    Public Shared Sub Main()

  4.       ' Creates a bar shape with holes at each end
  5.       Dim length As Double = 8
  6.       Dim width As Double = 4
  7.       Dim half As Double = width/2

  8.       Line(-half, 0, -half, length)      ' Left side of bar
  9.       Line( half, 0,  half, length)      ' Right side of bar
  10.                                                                                                                                           '
  11.       Arc(0, length, half, 0, 180)       ' Top semi-circle
  12.       Arc(0, 0, half, 180, 360)          ' Bottom semi-circle
  13.                                                                                                                                           '
  14.       Circle(0, length, 0.5)             ' Top hole
  15.       Circle(0, 0, 0.5)                  ' Bottom hole
  16.                                                                                                                                           '
  17.    End Sub

  18. End Class
复制代码






欢迎光临 UG爱好者 (https://www.ugsnx.com/) Powered by Discuz! X3.2