WHC405 发表于 2024-8-3 13:10:25

MasterCAM如何快速绘制距离递增平行线

MC如何快速绘制很多条距离递增的平行线

qswa555 发表于 2024-8-3 13:59:11

动态转换可以,不过也不是很快就是了

mayzhang1024 发表于 2024-8-8 08:21:10

用CAD VBA

mayzhang1024 发表于 2024-8-8 10:59:01

mayzhang1024 发表于 2024-8-8 08:21
用CAD VBA

‘以下示例画100条平行为Y轴的直线,X方向间距为2n+1的示例代码
Public Sub DrawLines()
    Dim i As Integer
    Dim startPoint(0 To 2) As Double
    Dim endPoint(0 To 2) As Double
    Dim spacing As Double
   
    startPoint(0) = 0
    startPoint(1) = 0
    startPoint(2) = 0
   
    For i = 0 To 99
      spacing = 2 * i + 1
      endPoint(0) = startPoint(0)
      endPoint(1) = startPoint(1) + 100 ' 假设每条直线长度为100
      endPoint(2) = startPoint(2)
      
      ThisDrawing.ModelSpace.AddLine startPoint, endPoint
      
      startPoint(0) = startPoint(0) + spacing ' 更新X坐标以实现间距
    Next i
End Sub

WHC405 发表于 2024-8-20 11:51:24

mayzhang1024 发表于 2024-8-8 10:59


谢谢,可是我只想在MC里面画这个线,不想转到其他软件再画
页: [1]
查看完整版本: MasterCAM如何快速绘制距离递增平行线