求注在VBA里实现复制移动偏移的代码
大侠们给写一个在此谢谢了 RetVal = object.Offset(Distance)‘ 偏移RetVal = object.Copy复制
object.Move Point1, Point2 wxd20130610 发表于 2014-3-2 22:47 static/image/common/back.gif
RetVal = object.Offset(Distance)‘ 偏移
RetVal = object.Copy复制
object.Move Point1, Point2
感谢您的回复能写个实例吗 Option Explicit
Sub Test11()
Dim L As AcadLine
Dim L1 As AcadLine
Dim L2 As AcadLine
Dim L3 As AcadLine
Dim Ent As AcadEntity
Dim V As Variant
Dim Pt1(0 To 2) As Double
Dim Pt2(0 To 2) As Double
Pt1(0) = 100: Pt1(1) = 100
Pt2(0) = 150: Pt2(1) = 200
Set L = ThisDrawing.ModelSpace.AddLine(Pt1, Pt2)
L.color = acRed
Set Ent = L.Copy
If TypeOf Ent Is AcadLine Then
Set L1 = Ent
L1.color = acGreen
End If
V = L.Offset(5)
If TypeOf V Is AcadLine Then
Set L2 = V
L2.color = acMagenta
End If
L.Move Pt1, Pt2
Set Ent = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
If TypeOf Ent Is AcadLine Then
Set L3 = Ent
L3.color = acBlue
End If
End Sub
谢谢各位高手的经验分享! wxd20130610 发表于 2014-3-5 12:55 static/image/common/back.gif
Option Explicit
Sub Test11()
感谢您的回复会了太谢谢了。在问个问题我想在运行一个宏另一个宏也跟着运行怎么写呀? 比如有两个宏,都写在thisdrawing中,一个函数是A1,另一个函数是A2,那么你在A1中调用A2,这样运行A1时就会运行A2了,不知道你是不是这个意思。 wxd20130610 发表于 2014-3-18 15:28 static/image/common/back.gif
比如有两个宏,都写在thisdrawing中,一个函数是A1,另一个函数是A2,那么你在A1中调用A2,这样运行A1时就会 ...
非常感谢以找到答案了 wxd20130610 发表于 2014-3-5 12:55 static/image/common/back.gif
Option Explicit
Sub Test11()
画图框的代码有吗 不知道什么意思?
页:
[1]
2