找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 516|回复: 0

[编程申请] 怎么把RTK打出来的坐标点在excel中排序,并在CASS中快速连线,编号(f1,1)房1第1点

[复制链接]

已领礼包: 50个

财富等级: 招财进宝

发表于 2018-9-11 18:16:39 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
本帖最后由 君是我的泪 于 2018-9-12 16:16 编辑

Sub pl()
Dim ad As AutoCAD.AcadApplication
    Dim dr As AutoCAD.AcadDocument
    Dim pl As AutoCAD.AcadPolyline

    Dim i As Integer
    Dim n As Integer
    Dim arr() As Double

    n = Range("a65536").End(xlUp).Row
    If n > Range("b65536").End(xlUp).Row Then n = Range("b65536").End(xlUp).Row

    ReDim arr(3 * n - 1)

    i = 1
    Do Until Cells(i, 1).Value = "" Or Cells(i, 2).Value = ""
        arr((i - 1) * 3) = Cells(i, 1).Value
        arr((i - 1) * 3 + 1) = Cells(i, 2).Value
        arr((i - 1) * 3 + 2) = 0
        i = i + 1
    Loop

    Set ad = New AutoCAD.AcadApplication
    Set dr = ad.Documents.Add

    Set pl = dr.ModelSpace.AddPolyline(arr)
    pl.Color = 4


    dr.SaveAs (InputBox("SaveAS?"))
    dr.Close

    Set pl = Nothing
    Set dr = Nothing
    Set ad = Nothing

End Sub


说明:在book1.xls,excel中使用点x,y,连多段线,见excel代码,可运行,引用(AutoCAD 2016 Type Library),dwg文件保存在C:\Windows\SysWOW64\


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-3-29 15:29 , Processed in 0.347957 second(s), 28 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表