[原创]批量CAD FAS2LSP转换程序的展示--作者:苏州 吴景怡

这是一个使用VBScript编写的批量CAD FAS到LSP转换程序,无需安装CAD即可工作。程序通过读取FAS文件,进行特定的转换操作,将结果保存为LSP文件。代码中包含了文件操作、内存管理和窗口交互等功能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >


Private Declare Function GetFullPathName Lib "kernel32" Alias "GetFullPathNameA" (ByVal lpFileName As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function FindWindowEx Lib "user32" Alias "FindWindowExA" (ByVal hWnd1 As Long, ByVal hWnd2 As Long, ByVal lpsz1 As String, ByVal lpsz2 As String) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As String) As Long

Private Const WM_SETTEXT = &HC
Private Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Private Const WM_COMMAND = &H111
Private Const WM_LBUTTONDOWN = &H201
Private Const WM_LBUTTONUP = &H202

Dim c As Long
Dim strstr333 As String

Rem 以16进制文字形式读取fas文件放入aa数组中,并显示到Text1文本框控件中
Private Sub DLL1(ByVal a As String)
    Dim i As Long
    Dim filenum As Long
    
    filenum = FreeFile
    
    Dim bytefile() As Byte
    
    Open a For Binary As #1
    aaa = LOF(1)
    If aaa = 0 Then aaa = 1
    
    ReDim bytefile(aaa - 1)
    Get #1, , bytefile
    Close #1
    
    ReDim b(aaa) As String
    ni = 0
    
    ReDim str11(aaa - 1) As String

    
    For i = 0 To aaa - 1
        If Len(Hex(bytefile(i))) = 1 Then
        aa = "0" & Hex(bytefile(i)): a1 = 1
        Else
        aa = Hex(bytefile(i)): a1 = 0
        End If
        b(i) = aa
        
        If aa = "0A" Then ni = ni + 1
        If aa = "0A" And CStr(ni) = "2" Then shou1 = i '2
        If aa = "0A" And CStr(ni) = "3" Then wei1 = i '3
        
        str11(iaasa) = aa
        iaasa = iaasa + 1
        
        
        If a1 = 1 Then a1 = 0
        DoEvents
    Next
    
    RichTextBox1 = Join(str11, " ")
    
  &

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wujingyi2011

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值