如何将偏移后所得的直线转变成直线实体
我在用VBA编程中使用了偏移语句,程序如下:Dim p(0 To 2) As Double, p1(0 To 2) As Double
Dim l As AcadLine
p(0) = 0: p(1) = 20: p(2) = 0
p1(0) = 100: p1(1) = 400: p1(2) = 0
Set l = ThisDrawing.ModelSpace.AddLine(p, p1)
Dim l1 As Variant
l1 = l.Offset(80)
偏移后所得的l1并不是直线实体,请问我如何将偏移后所得的l1转换成直线实体?
甚么意思?运行正常啊! 是运行正常,但是我用偏移的属性所得到的l1不是直线实体,好像是一个地址,我怎么才能把l1变成直线实体呢。
比如我再想对l1进行镜像,如:
l1.mirror()却不行,因为l1不是直线实体,我怎么才能将l1变为直线实体呢?
Sub test()
Dim p(0 To 2) As Double, p1(0 To 2) As Double
Dim l As AcadLine
p(0) = 0: p(1) = 20: p(2) = 0
p1(0) = 100: p1(1) = 400: p1(2) = 0
Set l = ThisDrawing.ModelSpace.AddLine(p, p1)
Dim l1 As Variant
l1 = l.Offset(80)
'获得偏移后的直线实体
Dim l2 As AcadLine
Set l2 = l1(0)
l2.color = acRed'把偏移后的直线变成红色
End Sub
我试过了您写的语句,非常好用,解决了直线实体的问题,非常感谢,以后可能还要请您多多指教。
页:
[1]