田草博客

互联网田草博客


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

微信 公众号:ByCAD

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

评论列表

所有评论
[89] [90] [91] [92] [93] [94] [95] [96] [97] [98]  ... [144]  
tiancao1001 于 2008-11-05 11:09 AM 发表评论:
上面的程序有个小问题,遇到直线的起点设终点是同一点就麻烦了,直线是可以重合的而样条曲线是不可以的。
因此要吧终点加上那么一点点,
'直线转化为样条曲线
Sub LineToSPline()
    Dim E  As AcadEntity
    Dim L  As AcadLine
    Dim StartTan(0 To 2) As Double '指定样条曲线的起点切向。
    Dim FitPoints(0 To 8) As Double '指定样条曲线的所有拟合点?
    Dim CenterP As Variant '直线中点
    Dim a(0 To 2) As Double '拟合样条曲线的端点和终点的方向
    Dim n As Long
    Dim i As Long
    Dim Sp As AcadSpline
    n = ThisDrawing.ModelSpace.Count
    For Each E In ThisDrawing.ModelSpace
        i = i + 1
        ThisDrawing.Utility.Prompt Int(i / n * 100) & "%" & vbCrLf
        DoEvents
        'ThisDrawing.Utility.Prompt L.ObjectName
        'If e.ObjectName = "AcDbLine" Then
        If TypeOf E Is AcadLine Then
            Set L = E
            
            CenterP = centerPoint(L.StartPoint, L.EndPoint)
            
            a(0) = L.StartPoint(0) - L.EndPoint(0)
            a(1) = L.StartPoint(1) - L.EndPoint(1)
            a(2) = L.StartPoint(1) - L.EndPoint(1)
            
            FitPoints(0) = L.StartPoint(0):     FitPoints(1) = L.StartPoint(1):     FitPoints(2) = L.StartPoint(2)
            FitPoints(3) = CenterP(0):          FitPoints(4) = CenterP(1):          FitPoints(5) = CenterP(2)
            FitPoints(6) = L.EndPoint(0) + 0.001:   FitPoints(7) = L.EndPoint(1) + 0.001:   FitPoints(8) = L.EndPoint(2)
            
            StartTan(0) = -a(0):      StartTan(1) = -a(1):      StartTan(2) = -a(2)
            
            Set Sp = ThisDrawing.ModelSpace.AddSpline(FitPoints, StartTan, StartTan)
            Sp.Layer = L.Layer
            Sp.color = L.color
            L.Delete
        End If
    Next E
End Sub
查看所评论的日志:VBA将所有的直线转换成样条曲线
tiancao1001 于 2008-11-03 09:18 PM 发表评论:
还原天正轴线字体

Sub HYTZZT()
    Dim T As AcadTextStyle
    Set T = ThisDrawing.TextStyles("_TCH_AXIS")
    T.fontFile = "complex.shx"
    T.BigFontFile = "gbcbig.shx"
    ThisDrawing.Regen acAllViewports
End Sub
查看所评论的日志:CAD VBA 统一标注样式中的字体
tiancao1001 于 2008-11-03 09:53 AM 发表评论:
国家和房地产是一伙的,黑着呢。
查看所评论的日志:阳台建筑面?
wwwnet 于 2008-11-02 07:57 PM 发表评论:
设计的时候,按《建设工程建筑面积计算规范》(GB/T 50535-2005)
卖房的时候,按房产测量规范 GB/T17986-2000 

少出设计费又。。。。。
可以卖个大价钱。。。呵呵呵。。。

房产开发商良心地大大地   huai    了。。。。
555555555555555
查看所评论的日志:阳台建筑面?
wwwnet 于 2008-11-02 07:19 PM 发表评论:
参数下不了........呵呵和
查看所评论的日志:建筑节能计算
tiancao1001 于 2008-11-01 02:46 PM 发表评论:
网友交流QQ群:11740834 
查看所评论的日志:田草日志
tyzhi222 于 2008-10-31 11:55 PM 发表评论:
你好,田草:
  我正在学习CAD的VBA,能不能发一份给我,非常感谢!!!!
tyzhi222@163.com。
查看所评论的日志:AutoCAD VBA 二次开发教程源码
tiancao1001 于 2008-10-31 02:47 PM 发表评论:
实现Flash中一次随机打开15个连接:
http://tiancao.net/qita/webwithinflash2/1.html
查看所评论的日志:田草日志
[89] [90] [91] [92] [93] [94] [95] [96] [97] [98]  ... [144]  
Tiancao Blog All Rights Reserved 田草博客 版权所有
Copyright ©