[求助]怎么将cad中的直线偏移一定距离
以下是源程序:程序的目的是在有各种图形的cad图中,把直线选出来,之后再将直线偏移一定的距离。 现在我可以选出直线,但是不知道该怎么偏移。请大家帮下忙~不盛感激。Dim acadDoc As Object
Dim acadApp As Object
Private Sub CmdTj_Click()
MsgBox "There are " & acadDoc.Layers.Count & " layer(s) in the drawing."
MsgBox "There are " & acadDoc.ModelSpace.Count & " object(s) in ModelSpace."
Dim objCount As Integer
Dim I As Integer
objCount = acadDoc.ModelSpace.Count
Dim mspaceObj As AcadObject
For I = 0 To objCount - 1
Set mspaceObj = acadDoc.ModelSpace.Item(I)
If mspaceObj.ObjectName = "AcDbLine" Then
MsgBox "The objects in ModelSpace include: " & mspaceObj.ObjectName, vbInformation, "Count Example"
End If
Next
End Sub
Private Sub Form_Load()
Set acadApp = GetObject(, ".Application")
Set acadDoc = acadApp.ActiveDocument
End Sub
Moves an object along a vector.
|
Signature
object.Move Point1, Point2
Object
,
The object or objects this method applies to.
Point1
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the first point of the move vector.
Point2
Variant (three-element array of doubles); input-only
The 3D WCS coordinates specifying the second point of the move vector.
Remarks
The two points you specify define a displacement vector indicating how far the given object is to be moved and in what direction.
谢谢了但是没怎么看明白,能不能稍微详细的解释一下。或者在我的程序的基础上给出源代码呢?
谢谢但是你说的是move我是问怎么offset?最好在我的程序基础上来点代码~~ mspaceObj.offset(dist) 在前面加 Dim entobj As AcadEntity
在该语句后 MsgBox "The objects in ModelSpace include: " & mspaceObj.ObjectName, vbInformation, "Count Example"
加 Set entobj = mspaceObj
entobj.Offset (-5)
-5为偏移量
已解决
不知到沿着直线偏移文字怎么弄的
页:
[1]