阅读:2070回复:5
mo 加载dwg文件?
<P>各位如何在mo中用程序加载dwg文件?不是在设计时在控件里加载</P>
<P>谢谢</P> |
|
1楼#
发布于:2005-03-31 15:43
<P>我是新手,但是看以前的帖子说dwg不是autocad的格式吗? 用mo基本功能是可以实现放大缩小</P><P>我就知道这些.....</P><P>同样关注中!!</P>
|
|
2楼#
发布于:2005-07-19 11:53
<P>你好啊,你说的加载是不是用MO怎样打开*.DWG文件吗。若需要程序代码,你把你的油箱地址发到我的油箱里。</P>
<P><a href="mailtxiaojinlai_302@163.com" target="_blank" >xiaojinlai_302@163.com</A></P> |
|
3楼#
发布于:2005-07-19 14:37
moview那个例子就有啊
|
|
|
4楼#
发布于:2005-07-20 08:04
可以加载,不能编辑
|
|
5楼#
发布于:2005-10-12 14:00
<P>CString CMyGISView::AddCadLayer(const CString ; path)<BR>{<BR> CString CADType[4];<BR> CADType[0] = "[CADArea]";<BR> CADType[1] = "[CADLine]";<BR> CADType[2] = "[CADPoint]";<BR> CADType[3] = "[CADText]";<BR> for(int i = 0;i < 4; i++)<BR> {<BR> CMoDataConnection Conn;<BR> if(!Conn.CreateDispatch(TEXT("MapObjects2.DataConnection")))<BR> return "";</P>
<P> Conn.SetDatabase(CADType + GetFileDirectory(path));<BR> if(!Conn.Connect())<BR> return "";</P> <P> CMoLayers layers(m_map.GetLayers());<BR> CMoMapLayer layer;<BR> if(!layer.CreateDispatch(TEXT("MapObjects2.MapLayer")))<BR> return "";<BR> CMoGeoDataset geoDataset(Conn.FindGeoDataset(GetFileName(path)));</P> <P> layer.SetGeoDataset(geoDataset);</P> <P><BR> if(i == 3)<BR> {<BR> CMoLabelRenderer LabelRend;<BR> LabelRend.CreateDispatch("MapObjects2.LabelRenderer");<BR> LabelRend.SetDrawBackground(false);<BR> LabelRend.SetHeightField("HeightText");<BR> LabelRend.SetField("Text");<BR> layer.SetRenderer(LabelRend);<BR> }<BR> layers.Add(layer);<BR> }<BR> return CString();<BR>}</P> |
|