Chuyển đến nội dung
Diễn đàn CADViet

vienbp2004

Thành viên
  • Số lượng nội dung

    6
  • Đã tham gia

  • Lần ghé thăm cuối

Bài đăng được đăng bởi vienbp2004


  1.  

    Tham khảo :

    Sub Ve()
        Dim points(1) As Variant
        points(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
        points(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
        ThisDrawing.SendCommand "line " & points(0)(0) & "," & points(0)(1) & "," & points(0)(2) & vbCr _
            & points(1)(0) & "," & points(1)(1) & "," & points(1)(2) & vbCr & vbCr
            
    End Sub
    
    

     lỗi codebox, nhấn vô "trả lời" đề xem code:

    Sub Ve()
        Dim points(1) As Variant
        points(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
        points(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
        ThisDrawing.SendCommand "line " & points(0)(0) & "," & points(0)(1) & "," & points(0)(2) & vbCr _
            & points(1)(0) & "," & points(1)(1) & "," & points(1)(2) & vbCr & vbCr
            
    End Sub

     

     

     

     

    Tham khảo :

    Sub Ve()
        Dim points(1) As Variant
        points(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
        points(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
        ThisDrawing.SendCommand "line " & points(0)(0) & "," & points(0)(1) & "," & points(0)(2) & vbCr _
            & points(1)(0) & "," & points(1)(1) & "," & points(1)(2) & vbCr & vbCr
            
    End Sub
    
    

     lỗi codebox, nhấn vô "trả lời" đề xem code:

    Sub Ve()
        Dim points(1) As Variant
        points(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
        points(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
        ThisDrawing.SendCommand "line " & points(0)(0) & "," & points(0)(1) & "," & points(0)(2) & vbCr _
            & points(1)(0) & "," & points(1)(1) & "," & points(1)(2) & vbCr & vbCr
            
    End Sub

     

     

    Vẽ không theo ý muốn bạn ơi, cụ thể là  nó  không vẽ từ điểm StartPoint


  2.  

    Tham khảo :

    Sub Ve()
        Dim points(1) As Variant
        points(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
        points(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
        ThisDrawing.SendCommand "line " & points(0)(0) & "," & points(0)(1) & "," & points(0)(2) & vbCr _
            & points(1)(0) & "," & points(1)(1) & "," & points(1)(2) & vbCr & vbCr
            
    End Sub
    
    

     lỗi codebox, nhấn vô "trả lời" đề xem code:

    Sub Ve()
        Dim points(1) As Variant
        points(0) = ThisDrawing.Utility.GetPoint(, "Enter StartPoint: ")
        points(1) = ThisDrawing.Utility.GetPoint(, "Enter EndPoint: ")
        ThisDrawing.SendCommand "line " & points(0)(0) & "," & points(0)(1) & "," & points(0)(2) & vbCr _
            & points(1)(0) & "," & points(1)(1) & "," & points(1)(2) & vbCr & vbCr
            
    End Sub

     


  3. ( Bài đăng dành cho người sử dụng VBA)

     

    Em không hiểu lắm về lệnh Sendcommand, các anh chị thành viên giúp  đở em, em có 1 yêu cầu bài toán là cho người dùng nhập vào 2 đểm, sau đó vẽ 1 đường thẳng nối 2 điểm trên sử dụng lệnh Sendcommand nhưng chương trình báo lỗi, chương trình như sau :

    Sub Ve()
        Dim Diemdau As Variant
        Dim Diemcuoi As Variant
        Dim Duongthang As AcadLine
        Dim Tam(0 To 2) As Double
        
        Diemdau = ThisDrawing.Utility.GetPoint(, Chr(13) & "Nhap diem dau :")
        Diemcuoi = ThisDrawing.Utility.GetPoint(Diemdau, Chr(13) & "Nhap vao diem  thu 2  :")
        ThisDrawing.SendCommand("_line" & chr(13) & Diemdau Diemcuoi & chr(13))
            
    End Sub

  4. Tôi đã học xong bài 2 : Thiết lập  ban đầu - tỷ lệ vẽ, tôi muốn hỏi


    Trong Video này tôi thấy khi vẽ hình vuông mỗi cạnh 3m thì nhập vào là @3000,3000,  nhưng nếu dùng khổ giấy A4 kích thước chỉ có 297x210 nhu vậy khi vẽ hình vuông nó tràn ra ngoài giấy


    Kèm theo BV :http://www.cadviet.com/upfiles/7/159881_hoi_2.dwg

×