6005831982
路人甲
路人甲
  • 注册日期2004-09-18
  • 发帖数80
  • QQ
  • 铜币258枚
  • 威望0点
  • 贡献值0点
  • 银元0个
阅读:1467回复:1

Help! 怎样将CAD的Dwg文件转到mo中(VB)

楼主#
更多 发布于:2004-10-10 12:40
<P>下面是代码,但运行不了,错误提示为:</P>
<P>实时错误‘91’
对象变量或With块变量未设置</P>
<P>代码为:
</P>
<P>Private Sub Command1_Click()
Dim lyr As New MapObjects2.MapLayer
dc.Database = "[CADArea]C:\CAD"
Set lyr.GeoDataset = dc.FindGeoDataset("Drawing1.dwg")
If lyr.Valid Then
lyr.Symbol.Color = moRed
lyr.Symbol.Size = 3
lyr.Symbol.SymbolType = moLineSymbol
Map1.Refresh
Map1.Layers.Add lyr
Else
MsgBox "null"
Exit Sub
End If
End Sub</P>
<P>Private Sub Map1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
Map1.Extent = Map1.TrackRectangle
Else
Map1.Pan
End If
End Sub</P>
<P>Private Sub Form1_Load()
Command1.Caption = "显示CAD文件"
End Sub</P>
<P> <IMG src="http://www.gisempire.com/bbs/Skins/Default/emot/em12.gif"><IMG src="http://www.gisempire.com/bbs/Skins/Default/emot/em12.gif"></P>
喜欢0 评分0
kmxl
路人甲
路人甲
  • 注册日期2004-10-30
  • 发帖数94
  • QQ
  • 铜币294枚
  • 威望0点
  • 贡献值0点
  • 银元0个
1楼#
发布于:2004-11-08 18:09
<img src="images/post/smile/dvbbs/em07.gif" />
举报 回复(0) 喜欢(0)     评分
游客

返回顶部