明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2002|回复: 5

[求助]如何看到offset命令偏移后直线的坐标?见程序

[复制链接]
发表于 2003-9-11 12:50 | 显示全部楼层 |阅读模式
本帖最后由 作者 于 2003-9-11 15:18:06 编辑

Sub LzcBeam()
Dim BeamWith As Integer
Dim LzcBeam As AcadLine
Dim LzcBeam_1 As Variant
Dim LzcBeam_2 As Variant
Dim BeamStartPoint As Variant
Dim BeamEndPoint As Variant
BeamWith = 50
BeamStartPoint = ThisDrawing.Utility.GetPoint(, "enter a point:")
BeamEndPoint = ThisDrawing.Utility.GetPoint(BeamStartPoint, "enter another a point")
For i = 0 To 10
Set LzcBeam = ThisDrawing.ModelSpace.AddLine(BeamStartPoint, BeamEndPoint)
    LzcBeam_1 = LzcBeam.Offset(BeamWith / 2)
    LzcBeam_2 = LzcBeam.Offset(-BeamWith / 2)
LzcBeam.Delete
BeamStartPoint = BeamEndPoint
BeamEndPoint = ThisDrawing.Utility.GetPoint(BeamStartPoint, "enter the next point")
Dim SP As Variant
' 为什么这行有问题,我如何才能看到偏移后直线的起点、终点坐标?
SP = LzcBeam_1 .Startpoint
MsgBox SP(0)
Next i
End Sub

在用offset命令偏移后,却不能编辑偏移后的直线,很是痛苦,请问各位如何才能编辑偏移后直线的起点和终点坐标?谢谢
发表于 2003-9-11 13:31 | 显示全部楼层
LzcBeam.Delete
   ......
SP = LzcBeam.Startx
对象删除后再读取它的属性,这是你的原意吗?
发表于 2003-9-11 13:32 | 显示全部楼层
问题多多:
1. 你把 LzcBeam对象给删除了,你还能得到其属性吗?
2. LzcBeam.Startx中的Startx是什么属性,没看懂。
 楼主| 发表于 2003-9-11 15:21 | 显示全部楼层
sorry!是我copy错误!改正如下:
SP = LzcBeam_1 .Startpoint(在原文已经修改)
对不起啊,由于错误浪费了大家一点时间,但是改正后,仍然不能运行,请问为什么?
发表于 2003-9-11 18:39 | 显示全部楼层
LzcBeam_1是一个可能由一个或多个对象组成变体数组,而不是简单的对象。
所以取出LzcBeam_1中的第一个对象可以使用LzcBeam_1(0)来取得,如:
  1. SP = LzcBeam_1(0) .Startpoint
复制代码

这样就可以。
 楼主| 发表于 2003-9-12 15:08 | 显示全部楼层
多谢MCCAD的指导,问题解决了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-26 22:13 , Processed in 0.309054 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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