就是错 发表于 2008-5-31 17:24:00

尺寸线问题!!

为什么我在VB调用CAD绘图时那个标注时的尺寸线特别长!!

guozi83 发表于 2008-6-1 14:07:00

    ..................
      If Abs(point1(0) - point2(0)) > 0 Then
         '水平方向
         location(0) = HMaxy + conLabel - conD * i
         location(1) = HMaxy + conLabel - conD * i
         location(2) = HMaxy + conLabel - conD * i
         
         pt1(0) = point1(0)
         pt1(1) = HMaxy + conLabel - 0.6 * conD - conD * i
         pt1(2) = 0
      
         pt2(0) = point2(0)
         pt2(1) = HMaxy + conLabel - 0.6 * conD - conD * i
         pt2(2) = 0
      
         Set dimObj = ThisDrawing.ModelSpace.AddDimRotated(pt1, pt2, location, 0)
         
         Set newText = ThisDrawing.TextStyles.Add("MYSTYLE")
         newText.height = TextH   ' 设定新样式的高度
         ThisDrawing.Application.ZoomAll
         ' 增加标注间隙的距离
         dimObj.TextGap = 4
         dimObj.TextColor = acRed
         dimObj.TextStyle = "MYSTYLE"
         ThisDrawing.Regen acAllViewports
         
      End If
...........
标注函数中 端线长度是pt1 ,pt2到点 locationx 或 y方向的差值大致相等;
可以通过改变pt1 和pt2 是x 或 y方向的值来控制端线长度

就是错 发表于 2008-6-6 16:32:00

虽然问题已解决了!!但还是要谢谢你!!!有劳了!
页: [1]
查看完整版本: 尺寸线问题!!