如何用VBA选择一个现有文件中的图形,并进行拉伸
如题比如说:现有一个图形中的一个园(而不是新建一个园),如何用VBA选择它,并用addextrudedsolid进行拉伸操作。
哪位帮我一下,谢谢啦。
[[i] 本帖最后由 19990714 于 2007-11-7 16:08 编辑 [/i]] Dim Entity As AcadEntity
Dim Count As Long
Count = ThisDrawing.ModelSpace.Count
i = 0
Do While i < Count
Set Entity = ThisDrawing.ModelSpace.Item(i)
If Entity.ObjectName = "AcDbCircle" And Entity.Layer = "圆所在图层" Then
If Entity.Radius =圆半径 Then
.
.
.
if..........................过滤完毕
可以使用图元属性进行工作了
TempArea = Entity.Area
Entity.Layer = "TEMP2"
Entity.Offset (-1)
Set TempEntity = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
NewArea = TempEntity.Area
If NewArea > TempArea Then '选择偏移方向
Entity.Layer = "QQQ"
Entity.Offset (2)
Entity.Layer = "PPP"
Else
Entity.Layer = "QQQ"
Entity.Offset (-2)
Entity.Layer = "PPP"
Entity.Update
End If
自己清理程序吧
页:
[1]