xuruilll 发表于 2003-1-6 17:21:00

请问各位大侠怎样用VBA实现用各种视图观看,如顶视图、左视图以及轴侧视图等?[求助

请问各位大侠怎样用VBA实现用各种视图观看,如顶视图、左视图以及轴侧视图等?[求助]请问各位大侠怎样用VBA实现用各种视图观看,如顶视图、左视图以及轴侧视图等?

efan2000 发表于 2003-1-6 20:29:00

Re: 用UCS对象创建用户坐标系

Sub ADDUCS()
    ' 在当前图纸创建名称为"New_UCS"的用户坐标系
    Dim ucsObj As AcadUCS
    Dim origin(0 To 2) As Double

    Dim xAxisPnt(0 To 2) As Double
    Dim yAxisPnt(0 To 2) As Double
   
    ' Define the UCS
    origin(0) = 4#: origin(1) = 5#: origin(2) = 3#
    xAxisPnt(0) = 5#: xAxisPnt(1) = 5#: xAxisPnt(2) = 3#
    yAxisPnt(0) = 4#: yAxisPnt(1) = 6#: yAxisPnt(2) = 3#
   
    ' 添加用户坐标系到当前图形的用户坐标系集合中
    Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPnt, yAxisPnt, "New_UCS")

    MsgBox ucsObj.name & " has been added." & vbCrLf & _
            "Origin: " & ucsObj.origin(0) & ", " & ucsObj.origin(1) _
            & ", " & ucsObj.origin(2), , "Add Example"
   
End Sub
页: [1]
查看完整版本: 请问各位大侠怎样用VBA实现用各种视图观看,如顶视图、左视图以及轴侧视图等?[求助