半径标注?
用这个方法进行半径标注RetVal = object.AddDimRadial(Center, ChordPoint, LeaderLength)
可是得到的标注都在圆弧外侧,如何才能让生成的标注在圆货圆弧的里侧???
谢谢 LeaderLength 用负值就可以在里面标了。 但是当负值的大于圆弧或圆的半径,标注就会标到另一半圆弧上了,如何解决? 晕,这个值你还计算不出来。
你可以通过求Center和ChordPoint的距离的一半的负值就可以了。 但是我的标注要随着比例的增大,标注的尺寸线要随之变大,尺寸标注就要大于半径,再这种情况下,如果都"通过求Center和ChordPoint的距离的一半的负值就可以了"
就把尺寸线的长度固定死了??? 我的程序如下:
<BR>Sub 半径标注()<BR>Dim myss As AcadSelectionSet<BR>Dim gpcode(0 To 1) As Integer<BR>Dim datavalue(0 To 1) As Variant<BR>Dim groupcode, datacode As Variant<BR>Dim dimObj As AcadDimRadial '用于创建半径标注<BR>Dim center As Variant '用于设定圆心坐标<BR>Dim chordPoint(0 To 2) As Double '用于设定标注点<BR>Dim pickPoint As Variant '选择图元对象时的拾取点<BR>Dim leaderLen As Double '设定引线的长度<BR>Dim entObj As AcadArc<BR>Dim i As Integer<BR>Dim ag As Double<BR> Do While ThisDrawing.SelectionSets.Count <> 0<BR> ThisDrawing.SelectionSets.Item(0).Delete<BR> Loop<BR> Scl = ThisDrawing.GetVariable("userr1")<BR> If Scl = 0 Then Scl = 500<BR> gpcode(0) = 0: datavalue(0) = "Arc"<BR> gpcode(1) = 8: datavalue(1) = "ROAD1D"<BR> groupcode = gpcode: datacode = datavalue<BR> Set myss = ThisDrawing.SelectionSets.Add("ms6")<BR> ThisDrawing.Utility.Prompt "请选择要标注道路转角弧线:" & vbCrLf & _<BR> "注意:本程序设定选择只对'ROAD1D'层上的道路有效!" '& vbCr<BR> Call myss.SelectOnScreen(groupcode, datacode)<BR> If myss.Count <> 0 Then<BR> For i = 0 To myss.Count - 1<BR> Set entObj = myss.Item(i)<BR> If entObj.EndAngle < entObj.StartAngle Then<BR> ag = entObj.StartAngle + (entObj.EndAngle + 3.1415629 * 2 - entObj.StartAngle) / 2<BR> Else<BR> ag = entObj.StartAngle + (entObj.EndAngle - entObj.StartAngle) / 2<BR> End If<BR> pickPoint = ThisDrawing.Utility.PolarPoint(entObj.center, ag, entObj.Radius)<BR> chordPoint(0) = pickPoint(0): chordPoint(1) = pickPoint(1)<BR> leaderLen = -20*scl/500 'SCL :比例尺,规定比例尺=500时 leaderLen = -20<BR> center = entObj.center<BR> Set dimObj = ThisDrawing.ModelSpace.AddDimRadial(center, chordPoint, leaderLen)<BR> dimObj.UnitsFormat = acDimLDecimal<BR> dimObj.DecimalSeparator = "."<BR> dimObj.TextHeight = 2<BR> dimObj.Fit = acTextAndArrows
dimObj.CenterType = acCenterNone<BR> <BR> Next i<BR> End If<BR>End Sub 你还是来个例图吧,我还是没搞懂你的要求。 会不会是系统变量的问题。或者标注样式的问题。我认为你要先保证你手动可以出来你说的效果,然后在用程序来实现它。
明总各位大虾,再次麻烦你们了 你说的这一段跟半径标注没有关系
页:
[1]
2