明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1052|回复: 1

作业,把vba代码封成dll实在搞不会

[复制链接]
发表于 2020-4-13 00:38:57 | 显示全部楼层 |阅读模式

就这样把确定里的那些封装到dll并引用

Dim pt1(0 To 2) As Double
Dim pt2(0 To 2) As Double
Dim pt3(0 To 2) As Double
Dim pt4(0 To 2) As Double
Dim pt5(0 To 2) As Double
Dim pt6(0 To 2) As Double
Dim pt7(0 To 2) As Double
Dim pt8(0 To 2) As Double
Dim pt9(0 To 2) As Double
Dim pt10(0 To 2) As Double
Dim pt11(0 To 2) As Double
Dim pt12(0 To 2) As Double
Dim pt13(0 To 2) As Double
Dim pt14(0 To 2) As Double

l = TextBox1.Text
w = TextBox2.Text
d = TextBox3.Text
d1 = TextBox4.Text
d2 = TextBox5.Text
d3 = TextBox10.Text
x1 = TextBox16.Text
y1 = TextBox17.Text




pt1(0) = 1 * d2 + 1 * d + 0.5 * l
pt1(1) = 0
pt1(2) = 0

pt2(0) = 1 * d2 + 1 * d + 1 * x1
pt2(1) = 0
pt2(2) = 0

pt3(0) = 1 * d2 + 1 * d + 1 * x1
pt3(1) = 1 * d3 + 1 * d1 + 1 * y1
pt3(2) = 0

pt4(0) = 0
pt4(1) = 1 * d3 + 1 * d1 + 1 * y1
pt4(2) = 0

pt5(0) = 0
pt5(1) = 1 * d3 + 1 * d1 + 0.5 * w
pt5(2) = 0


ThisDrawing.ModelSpace.AddLine pt1, pt2
ThisDrawing.ModelSpace.AddLine pt2, pt3
ThisDrawing.ModelSpace.AddLine pt3, pt4
ThisDrawing.ModelSpace.AddLine pt4, pt5



pt6(0) = 1 * d2 + 1 * d + 1 * x1
pt6(1) = 1 * d3
pt6(2) = 0

pt7(0) = 1 * d2 + 1 * x1
pt7(1) = 1 * d3 + 1 * d1 + 1 * y1
pt7(2) = 0

pt8(0) = 1 * d2 + 1 * x1
pt8(1) = 1 * d3 + 1 * d1 + 1 * y1 + 0.5 * w
pt8(2) = 0


pt9(0) = 1 * d2 + 1 * d + 1 * x1
pt9(1) = 1 * d3 + 1 * d1 + 1 * y1 + 0.5 * w
pt9(2) = 0


pt10(0) = 1 * d2 + 1 * d + 0.5 * l
pt10(1) = 1 * d3 + 1 * d1 + 1 * y1
pt10(2) = 0


pt11(0) = 1 * d2 + 1 * d + 0.5 * l
pt11(1) = 1 * d3
pt11(2) = 0
。。。。

本帖子中包含更多资源

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

x
 楼主| 发表于 2020-4-13 00:56:59 来自手机 | 显示全部楼层
求大神教导,留下qq,有偿也行
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 05:31 , Processed in 0.147413 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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