图中的两条红线的标注尺寸怎么获得呢?
<SUB>横的红线没有直接标注,但是我想要通过其他的标注得到他的标注尺寸,该怎么做呢?</SUB><SUB>还有就是那条竖线,尺寸没有直接标注的他的上面??好无奈哦,请指点啦!!!谢谢</SUB>
横的红线没有直接标注,但是我想要通过其他的标注得到他的标注尺寸,该怎么做呢?
<BR>还有就是那条竖线,尺寸没有直接标注的他的上面??好无奈哦,请指点啦!!!谢谢
<SUB></SUB> 谢谢各位啦
你得到其标注是想来做什么?<BR>标注的尺寸值(也就是线的长度)本身可以通过对象本身的属性来获得。<BR>按你图中的标注位置,可以通过位置来得以其标注,但你的其它图是不是也这样标注,我就不清楚了。所以关键是找到规律,如果没有规律,也就没有办法。 可以通过XY轴判断
Function GetDimByX(ByVal X)
'获取一标注点的横坐标为X的所有标注
Dim FilterType(6) As Integer
Dim FilterData(6) As Variant
Dim pDims() As AcadObject
Dim ss As AcadSelectionSet
Dim pnt(2) As Double
pnt(0) = X
FilterType(0) = 0
FilterData(0) = "Dim*"
FilterType(1) = -4
FilterData(1) = "<or"
FilterType(2) = -4
FilterData(2) = "=,*,*"
FilterType(3) = 13
FilterData(3) = pnt
FilterType(4) = -4
FilterData(4) = "=,*,*"
FilterType(5) = 14
FilterData(5) = pnt
FilterType(6) = -4
FilterData(6) = "or>"
Set ss = ThisDrawing.ActiveSelectionSet
ss.Clear
ss.Select acSelectionSetAll, , , FilterType, FilterData
ReDim pDims(ss.Count - 1)
For i = 0 To ss.Count - 1
Set pDims(i) = ss(i)
Next i
GetDimByX = pDims
End FunctionFunction GetDimByY(ByVal Y)
'获取一标注点的纵坐标为Y的所有标注
Dim FilterType(6) As Integer
Dim FilterData(6) As Variant
Dim pDims() As AcadObject
Dim ss As AcadSelectionSet
Dim pnt(2) As Double
pnt(1) = Y
FilterType(0) = 0
FilterData(0) = "Dim*"
FilterType(1) = -4
FilterData(1) = "<or"
FilterType(2) = -4
FilterData(2) = "*,=,*"
FilterType(3) = 13
FilterData(3) = pnt
FilterType(4) = -4
FilterData(4) = "*,=,*"
FilterType(5) = 14
FilterData(5) = pnt
FilterType(6) = -4
FilterData(6) = "or>"
Set ss = ThisDrawing.ActiveSelectionSet
ss.Clear
ss.Select acSelectionSetAll, , , FilterType, FilterData
ReDim pDims(ss.Count - 1)
For i = 0 To ss.Count - 1
Set pDims(i) = ss(i)
Next i
GetDimByY = pDims
End FunctionSub Test2()
Dim obj As AcadLine
ThisDrawing.Utility.GetEntity obj, pnt
Dim a As Double
a = obj.StartPoint(0)
For Each i In GetDimByX(a)
MsgBox i.ObjectName
Next i
End Sub
页:
[1]