田草博客

互联网田草博客


网友交流QQ群:11740834 需注明申请加入原因

微信 公众号:ByCAD

邮箱:tiancao1001x126.com
ByCAD,微信公众号
首页 | 普通 | 电脑 | AutoCAD | VB/VB.NET | FLash | 结构 | 建筑 | 电影 | BIM | 规范 | 软件 | ID

评论列表

tiancao1001
所发表的评论
[21] [22] [23] [24] [25] [26] [27] [28] [29] [30]  ... [37]  
tiancao1001 于 2009-03-03 03:32 PM 发表评论:
利用ShellExecute可以直接打开文件:
Private Const SW_SHOWNA = 8
Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
Private Sub Command1_Click()
ShellExecute Me.hwnd, "open", "c:\temp.jpg", "", "", SW_SHOWNA
End Sub 

vb中使用shell,执行系统变量
查看所评论的日志:田草日志
tiancao1001 于 2009-03-03 03:31 PM 发表评论:
2009年的第一个工程确是一块广告牌
查看所评论的日志:田草日志
tiancao1001 于 2009-02-22 11:25 PM 发表评论:
Sub XXX()
   On Error GoTo ErrControl
    
    Dim SSet As AcadSelectionSet
    Set SSet = CreateSelectionSet("XXX")
    Dim fType, fData
    BuildFilter fType, fData, 0, "LWPolyline"
    
    '选择矩形
    SSet.SelectOnScreen fType, fData
    
    Dim PL As AcadLWPolyline
    Dim New_Pl  As Variant
    Dim Pmin As Variant
    Dim Pmax As Variant
    Dim L As Double
    Dim H As Double
    For Each PL In SSet
        '偏移矩形
        New_Pl = PL.offset(100)
        '偏移后的矩形角点
        New_Pl(0).GetBoundingBox Pmin, Pmax
        L = Pmin(0) - Pmax(0) '矩形长
        H = Pmax(1) - Pmax(1) '矩形宽
        '在矩形内部写上 长x宽
        TxtHatch Format(L, "0.00") & "x" & Format(H, "0.00"), Pmin, Pmax, 0
        PL.Delete
    Next
ErrControl:

End Sub
Public Function TxtHatch(ByVal Str As String, ByVal P1 As Variant, P2 As Variant, a As Double) As AcadText
    Dim Txt As AcadText
    Dim TxtH As Double
    Dim TxtL As Double
    Dim RecL As Double
    Dim RecH  As Double
    Dim Center1(2) As Double
    Dim Pmin As Variant, Pmax As Variant
    If Abs(P1(0) - P2(0)) = 0 Or Abs(P1(1) - P2(1)) = 0 Then Exit Function
    If a = 0 Then
        RecL = Abs(P1(0) - P2(0))
        RecH = Abs(P1(1) - P2(1))
    Else
        RecL = Abs(P1(1) - P2(1))
        RecH = Abs(P1(0) - P2(0))
    End If
    Center1(0) = (P1(0) + P2(0)) / 2
    Center1(1) = (P1(1) + P2(1)) / 2
    Center1(2) = (P1(2) + P2(2)) / 2
    Set Txt = ThisDrawing.ModelSpace.AddText(Str, Point3D(0, 0, 0), 2.5)
    Txt.GetBoundingBox Pmin, Pmax
    TxtL = Abs(Pmin(0) - Pmax(0))
    TxtH = Abs(Pmin(1) - Pmax(1))
    If RecL / TxtL <= RecH / TxtH Then
        Txt.ScaleEntity Pmin, RecL / TxtL
    Else
        Txt.ScaleEntity Pmin, RecH / TxtH
    End If
    Txt.Alignment = acAlignmentMiddleCenter
    Txt.Move Txt.TextAlignmentPoint, Center1
    Txt.Rotate Center1, a * Atn(1) * 4 / 180
    Set TxtHatch = Txt
End Function
 
查看所评论的日志:田草CAD工具箱—>自动绘制PKPM轴线网
tiancao1001 于 2009-02-21 10:08 AM 发表评论:
你好当然可以。稍后给你献上。
感谢支持,
查看所评论的日志:田草CAD工具箱—>自动绘制PKPM轴线网
tiancao1001 于 2009-02-21 09:14 AM 发表评论:
你好,
P2PDistance,就是个求点到点的直线距离的,你自己补充吧?
我分享的代码只能提供一种思路,和解决方法。
查看所评论的日志:折断线绘制
tiancao1001 于 2009-02-20 10:11 AM 发表评论:
'删除图纸中的所有点对象
Sub DelAllPoint()
    Dim E As AcadEntity
    Dim B As AcadBlock
    For Each B In ThisDrawing.Blocks
        For Each E In B
            If TypeOf E Is AcadPoint Then
                E.Delete
            End If
        Next
    Next
    ThisDrawing.Regen
End Sub

查看所评论的日志:田草日志
tiancao1001 于 2009-02-18 02:46 PM 发表评论:
谢谢,指点,希望能向你学习。
我的QQ号码:327750885
查看所评论的日志:Visual Basic 2005 飞信SDK开发短信收发程序
tiancao1001 于 2009-02-16 01:51 PM 发表评论:
ip地址查询代码二:
<script src="http://www.tiancao.net/ip/ip.asp" language="JavaScript" charset="gb2312"></script> 
查看所评论的日志:本站显示ip地址代码
[21] [22] [23] [24] [25] [26] [27] [28] [29] [30]  ... [37]  
Tiancao Blog All Rights Reserved 田草博客 版权所有
Copyright ©