- 积分
- 2262
- 明经币
- 个
- 注册时间
- 2004-12-30
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
我写了一段CASS展点程序,可是展上去的点没办法写上扩展属性,不能让CASS识别。我知道CASS在展点时写上了一个隐藏的“SOUTH”属性,值为202101,可是用VBA怎么样才能将这个属性写上去?我的原程序如下,请各位高手指点:
Sub zgcd() Dim pn As Variant Dim pnt(0 To 2) As Double Dim blockRefObj As AcadBlockReference Dim textObj As AcadText Dim dh As String Dim x As Double Dim y As Double Dim z As Double Dim pcode As String Dim ly As AcadLayer UserForm4.Show Dim texth As Double
Set ly = ThisDrawing.Layers.Add("高程") ly.color = acGreen Set ly = ThisDrawing.Layers.Add("点号") ly.color = acMagenta Set ly = ThisDrawing.Layers.Add("GCD") ly.color = acRed UserForm1.CommonDialog1.Filter = "All Files|*.*|*.dat|*.dat|" UserForm1.CommonDialog1.FilterIndex = 2 UserForm1.CommonDialog1.DefaultExt = ".dat" UserForm1.CommonDialog1.Action = 1 fl1 = UserForm1.CommonDialog1.FileName If fl1 = "" Then Exit Sub Open fl1 For Input As #1 Line Input #1, dh I = InStr(1, dh, ",") If I > 0 Then Close #1 Open fl1 For Input As #1 End If I = 0 Do While Not EOF(1) On Error GoTo ex1 Input #1, dh, pcode, x, y, z pnt(0) = x pnt(1) = y pnt(2) = z If pnt(0) * pnt(1) * pnt(2) <> 0 Then Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(pnt, "GC200", 0.1, 0.1, 1#, 0) blockRefObj.Layer = "GCD" blockRefObj.color = acByLayer
'这里应该写点什么才能将点的SOUTH属性设成202101
Set textObj = ThisDrawing.ModelSpace.AddText(pnt(2), pnt, 0.2) textObj.Layer = "高程" textObj.color = acByLayer
pnt(0) = pnt(0) - Len(dh) * 0.2 Set textObj = ThisDrawing.ModelSpace.AddText(dh, pnt, 0.2) textObj.Layer = "点号" textObj.color = acByLayer
I = I + 1 End If Loop ThisDrawing.Utility.prompt ("共展高程点:" & Str(I) & "个" & Chr$(13) + Chr$(10)) Close #1 ex1: ThisDrawing.Application.ZoomExtents End Sub
|
|