明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1842|回复: 0

谁来帮帮我?

[复制链接]
发表于 2005-6-6 17:48:00 | 显示全部楼层 |阅读模式
我写了一段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
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 09:52 , Processed in 0.156205 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表