使用旋转标注,就可以标注任何角度的内容!
'自定义函数,创建能够修改尺寸文字的旋转标注函数(可用于水平和垂直标注) Public Function AddDimRotatedCTxt(pt1 As Variant, pt2 As Variant, ptText As Variant, angle As Double, text As String) As AcadDimRotated Dim objDim As AcadDimRotated Set objDim = docObj.ModelSpace.AddDimRotated(pt1, pt2, ptText, angle) objDim.TextOverride = text objDim.ArrowheadSize = 2.5 * drawScale '改变箭头大小(以缩放比例为基准) objDim.TextHeight = 3.5 * drawScale '改变文字高度(以缩放比例为基准) objDim.TextGap = 1# * drawScale objDim.ExtensionLineExtend = 2# * drawScale objDim.Update Set AddDimRotatedCTxt = objDim End Function |