乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 31|回复: 0

高手们帮帮忙吧

[复制链接]

5

主题

13

帖子

3

银币

初来乍到

Rank: 1

铜币
33
发表于 2013-4-19 20:33:00 | 显示全部楼层 |阅读模式
Private Type muxian
xb As Long
yb As Long
zb As Long
xe As Long
ye As Long
ze As Long
End Type
Private Type bianyaqi
x1b As Long
y1b As Long
z1b As Long
x1e As Long
y1e As Long
z1e As Long
End Type
Sub bianyaqi()
Dim am() As muxian
Dim xy As Variant
Dim m1 As Integer
Dim entity As AcadBlockReference
For Each entity In ThisDrawing.ModelSpace
ReDim Preserve am(m1)
Call entity.GetXData("", xdatatype, xdatavalue)
strcode1 = xdatavalue(1)
If strcode1 = "母线" Then
xy = entity.InsertionPoint
MsgBox ("xy") & xy(0)
With am(m1)
.xb = xy(0)
.yb = xy(1)
.zb = xy(2)
.xe = xy(0) + 70
.ye = xy(1)
.ze = xy(2)
End With
MsgBox ("am(i)=") & am(0).xb
End If
m1 = m1 + 1
Next
Dim pt As Variant
pt = ThisDrawing.Utility.GetPoint(, "指定点:")
For i = 0 To m1
If pt(0) > am(i).xb - 40 And pt(0)  am(i).yb - 40 And pt(1)  Sqr((am(i).xe - pt(0)) ^ 2 + (am(i).ye - pt(1)) ^ 2) Then
pt(0) = am(i).xe
pt(1) = am(i).ye
pt(2) = am(i).ze
Else
pt(0) = am(i).xb
pt(1) = am(i).yb
pt(2) = am(i).zb
End If
End If
Next
为什么在这个程序里,给结构体赋值不能成功呢???输出的值总是0,初学者,求指教!!
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-6-29 17:55 , Processed in 1.620278 second(s), 66 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表