- UID
- 292482
- 积分
- 0
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2005-7-12
- 最后登录
- 1970-1-1
|
发表于 2006-12-24 13:50:51
|
显示全部楼层
没办法直接设置,只能通过选择集,获取其插入点\对齐点,字高,宽高比,TEXT文本内容,追加个TEXT文本,删除老的文本. Select Case Trim(xdataOut(1))
Case "121211"
Set newTextStyle = ThisDrawing.TextStyles.Add("细等线体")
ThisDrawing.ActiveTextStyle = newTextStyle
' ThisDrawing.ActiveTextStyle.fontFile = "c:\WINDOWS\Fonts\FZXDXJW.TTF"
vps1 = ent.textString
vps = ent.insertionPoint
vps3 = ent.Alignment
vps4 = ent.TextAlignmentPoint
vps(0) = vps(0) + 3
vps(1) = vps(1)
vps(2) = vps(2)
' ThisDrawing.ActiveTextStyle.fontFile = "FZXDXJW.TTF" '使用指定字体
Set tex = ThisDrawing.ModelSpace.AddText(vps1, vps, Int(2# / 2 * 100) / 100)
ent.Delete
tex.Alignment = vps3
tex.TextAlignmentPoint = vps4
tex.height = Int(2# / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 0.8 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121211"
DataType(2) = 1003: Data(2) = "TK"
tex.SetXData DataType, Data
Case "121205"
Set newTextStyle = ThisDrawing.TextStyles.Add("等线体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.fontFile = "c:\WINDOWS\Fonts\SIMHEI.TTF"
vps1 = ent.textString
If Right(vps1, 1) = "." Then
vps = ent.insertionPoint
vps3 = ent.Alignment
vps4 = ent.TextAlignmentPoint
vps4(0) = vps4(0) + 0.3
vps4(1) = vps4(1) - 0.75
vps4(2) = vps4(2)
Set tex = ThisDrawing.ModelSpace.AddText((Right(vps1, Len(vps1) - 1)), vps, Int(3 / 2 * 100) / 100)
ent.Delete
tex.Alignment = vps3
tex.TextAlignmentPoint = vps4
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 0.8 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121205"
DataType(2) = 1003: Data(2) = "TK"
tex.SetXData DataType, Data
ElseIf Left(vps1, 2) = "37" And Len(vps1) = 7 Then
vps1 = Right(vps1, Len(vps1) - 2)
vps = ent.insertionPoint
vps3 = ent.Alignment
vps4 = ent.TextAlignmentPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText(vps1, vps, Int(3 / 2 * 100) / 100)
ent.Delete
tex.Alignment = vps3
tex.TextAlignmentPoint = vps4
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 0.8 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121205"
DataType(2) = 1003: Data(2) = "TK"
tex.SetXData DataType, Data
Else
vps = ent.insertionPoint
vps3 = ent.Alignment
vps4 = ent.TextAlignmentPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText(vps1, vps, Int(3 / 2 * 100) / 100)
ent.Delete
tex.Alignment = vps3
tex.TextAlignmentPoint = vps4
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 0.8 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121205"
DataType(2) = 1003: Data(2) = "TK"
tex.SetXData DataType, Data
End If
Case "121206"
ent.height = Int(3.75 / 2 * 100) / 100
ent.VerticalAlignment = 0 '垂直调整
ent.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
ent.ScaleFactor = 1 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121206"
DataType(2) = 1003: Data(2) = "TK"
tex.SetXData DataType, Data
Case "121207"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
vps1 = ent.textString
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
' ThisDrawing.ActiveTextStyle.fontFile = "SIMKAI.TTF" '使用指定字体
Set tex = ThisDrawing.ModelSpace.AddText(zbxt, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.4 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1) + 0.9
vps(2) = vps(2)
tex.insertionPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121207"
tex.SetXData DataType, Data
Case "121208"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
vps1 = ent.textString
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
' ThisDrawing.ActiveTextStyle.fontFile = "SIMKAI.TTF" '使用指定字体
Set tex = ThisDrawing.ModelSpace.AddText(gcjz, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.4 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1) + 0.9 + 0.1
vps(2) = vps(2)
tex.insertionPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121208"
tex.SetXData DataType, Data
Case "121209"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
vps1 = ent.textString
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
' ThisDrawing.ActiveTextStyle.fontFile = "SIMKAI.TTF" '使用指定字体
Set tex = ThisDrawing.ModelSpace.AddText(dcgc, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.4 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1) + 0.9 + 0.1 * 2
vps(2) = vps(2)
tex.insertionPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121209"
tex.SetXData DataType, Data
Case "121210"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
vps1 = ent.textString
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
' ThisDrawing.ActiveTextStyle.fontFile = "SIMKAI.TTF" '使用指定字体
Set tex = ThisDrawing.ModelSpace.AddText(dcrq, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.4 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1) + 0.9 + 0.1 * 3
vps(2) = vps(2)
tex.insertionPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121210"
tex.SetXData DataType, Data
vps(0) = vps(0)
vps(1) = vps(1) - 2.15
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText(chdw + chrq, vps, Int(1.9 / 2 * 100) / 100)
tex.ScaleFactor = 1.375
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121288"
tex.SetXData DataType, Data
Case "121203"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
ent.height = Int(2.7 / 2 * 100) / 100
ent.VerticalAlignment = 0 '垂直调整
ent.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
ent.ScaleFactor = 1 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
ent.insertionPoint = vps
vps = ent.insertionPoint
Set tex = ThisDrawing.ModelSpace.AddText(ent.textString, vps, Int(3.6 / 2 * 100) / 100)
tex.ScaleFactor = 0.8
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121286"
tex.SetXData DataType, Data
ent.Delete
Case "121212"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
' ent.TextString = "调查员: " + dcy
ent.insertionPoint = vps
vps = ent.insertionPoint
vps(0) = vps(0)
vps(1) = vps(1)
vps(2) = vps(2)
' ThisDrawing.ActiveTextStyle.fontFile = "SIMFANG.TTF" '使用指定字体
Set tex = ThisDrawing.ModelSpace.AddText("调查员: " + dcy, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.375 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0) + 10.4
vps(1) = vps(1) + 1.3
vps(2) = vps(2)
tex.insertionPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121212"
tex.SetXData DataType, Data
Case "121213"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
ent.insertionPoint = vps
vps = ent.insertionPoint
vps(0) = vps(0) + 10.4
vps(1) = vps(1) + 1.3 + 0.5
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText("测图员: " + cly, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.375 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121213"
tex.SetXData DataType, Data
Case "121214"
Set newTextStyle = ThisDrawing.TextStyles.Add("宋体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.SetFont "宋体", False, False, 1, 1
ent.insertionPoint = vps
vps = ent.insertionPoint
vps(0) = vps(0) + 10.4
vps(1) = vps(1) + 1.3 + 0.5 * 2
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText("绘图员: " + hty, vps, Int(1.9 / 2 * 100) / 100)
ent.Delete
tex.height = Int(1.9 / 2 * 100) / 100
tex.VerticalAlignment = 0 '垂直调整
tex.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
tex.ScaleFactor = 1.375 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121214"
tex.SetXData DataType, Data
vps(0) = vps(0)
vps(1) = vps(1) - 2#
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText("检查员: " + jcy, vps, Int(1.9 / 2 * 100) / 100)
tex.ScaleFactor = 1.375
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121289"
tex.SetXData DataType, Data
Case "121201"
Set newTextStyle = ThisDrawing.TextStyles.Add("等线体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.fontFile = "c:\WINDOWS\Fonts\SIMHEI.TTF"
ent.height = Int(6 / 2 * 100 * 6 / 7.5) / 100
ent.VerticalAlignment = 0 '垂直调整
ent.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
ent.ScaleFactor = 1 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121201"
ent.SetXData DataType, Data
ent.ScaleFactor = 1 '调整宽高比例
Case "121202"
Set newTextStyle = ThisDrawing.TextStyles.Add("等线体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.fontFile = "c:\WINDOWS\Fonts\SIMHEI.TTF"
ent.height = Int(4.5 / 2 * 100) / 100
ent.VerticalAlignment = 0 '垂直调整
ent.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
ent.ScaleFactor = 0.8 '调整宽高比例
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121202"
ent.SetXData DataType, Data
yjq10 = Right(Left(ent.textString, 7), 5)
yjq11 = Right(ent.textString, 5)
ent.textString = yjq10 + "-" + yjq11
Case "121204"
Set newTextStyle = ThisDrawing.TextStyles.Add("等线体")
ThisDrawing.ActiveTextStyle = newTextStyle
ThisDrawing.ActiveTextStyle.fontFile = "c:\WINDOWS\Fonts\SIMHEI.TTF"
' ThisDrawing.ActiveTextStyle.fontFile = "c:\WINDOWS\Fonts\FZZDXJW.TTF"
ent.height = Int(3 / 2 * 100 * 3 / 3.5) / 100
ent.VerticalAlignment = 0 '垂直调整
ent.ObliqueAngle = 0 '文本倾斜 左负 右正,取的正弦值
ent.ScaleFactor = 1.33 '调整宽高比例
vps = ent.insertionPoint
vps(0) = vps(0) - 2.5
vps(1) = vps(1)
vps(2) = vps(2)
ent.insertionPoint = vps
vps = ent.insertionPoint
vps(0) = vps(0) - 31
vps(1) = vps(1) + 0.15
vps(2) = vps(2)
Set tex = ThisDrawing.ModelSpace.AddText(dcqy + "地籍图", vps, Int(2.5 / 2 * 100 + 2.5 / 3) / 100)
tex.ScaleFactor = 1.5
tex.Alignment = acAlignmentLeft
tex.TextAlignmentPoint = vps
DataType(0) = 1001: Data(0) = "SOUTH"
DataType(1) = 1000: Data(1) = "121287"
tex.SetXData DataType, Data
End Select |
|