阅读:1626回复:1
Help! 怎样将CAD的Dwg文件转到mo中(VB)
<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> |
|
1楼#
发布于:2004-11-08 18:09
<img src="images/post/smile/dvbbs/em07.gif" />
|
|