POST
|
It's really, really easy. Instead of reading the elements from the DGN directly, simply use geoprocessing tools such as CopyFeatures and FeatureClass to FeatureClass. These tools can accept the DGN Polygon feature class as input and then output a SHP file for you. You can access the geoprocessor directly from C# using ArcObjects. Really ? Thank you. I will try it, do you have any sample code ? Thank you very much !
... View more
04-10-2013
04:53 PM
|
0
|
0
|
8148
|
POST
|
Yes .. It comes as part of Engine Extension.. You will need to add it as ArcGIS reference from the set of libraries under Engine Extension if you have bought license for that. In case you did not buy that extension, try using classes in ESRI.ArcGIS.ConversionTools provided in help. the answer might not please you but thats is all i can say .. 🙂 Yes. Thank you
... View more
04-05-2013
12:53 AM
|
0
|
0
|
8148
|
POST
|
Hi, You could use Data Interoperability Tools to convert DGN into shapefile. I did convert a dgn to Geodatabase format using CadToGeodatabase class, there is also a class available to convert from DGN to shapefile as well. You could also use QuickImport , QuickExport Classes, check out the examples in the help. Regards, Pavan Thanks Pavan, What is "Data Interoperability Tools", is it dll file ? Could you please tell more how to get and use it ? Kind regards, Tai
... View more
04-03-2013
01:47 AM
|
0
|
0
|
8148
|
POST
|
Hi everyone, My project include two form: Main form and child form. Each form contains: 1 MapControl and 1 toolbarcontrol. And I added a ControlsEditingEditorMenu to each toolbarcontrol I can use ControlsEditingEditorMenu in the main form. But when I open a new form (child form) from the main form, I can't use ControlsEditingEditorMenu (it is disable/ not hightlight when clicking). I used below codes to add item. axToolbarControl2.AddItem("esriControls.ControlsEditingEditorMenu", 0, -1, false, 0, esriCommandStyles.esriCommandStyleIconOnly); Are there anyone know how to fix it ? Thanks and regards,
... View more
04-02-2013
12:19 AM
|
0
|
0
|
481
|
POST
|
Hi, I found out the reason, In Load function, I fogot a line: pageLayout.Actiview.FocusMap = map.Map above the line pageLayOut.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); Kind regards,
... View more
03-27-2013
01:40 AM
|
0
|
0
|
216
|
POST
|
Hi everyone, I am having a dgn file that include some polygon. Now I want to convert it into the shape file (.shp/.dbf file), are there anyone know this ? PS: I can read elements (line/text/linestring) from the dgn file, but I don't know how to create an shape file and draw them (geometry) in the shape file using arcobjects (C#) Thank you for your help !
... View more
03-27-2013
01:31 AM
|
0
|
9
|
32589
|
POST
|
Hi, I used below codes to save IMap into byte[] (to store in my database), but I can't load it again, are there anyone know what's wrong ? public byte[] SaveMap(AxPageLayoutControl pageLayOut) { IGraphicsContainer graphicsContainer = pageLayOut.GraphicsContainer; graphicsContainer.Reset(); IElement pElement = graphicsContainer.Next(); while (pElement != null) { if (pElement is IMapFrame) { IMapDocument mapDocument = new MapDocumentClass(); if (File.Exists(@"D:\test.mxd")) File.Delete (@"D:\test.mxd"); mapDocument.New(@"D:\test.mxd"); mapDocument.ReplaceContents((IMxdContents)pageLayoutTo2_3.ActiveView.FocusMap); mapDocument.Save(true, true); System.IO.FileStream objFileStream = new System.IO.FileStream(@"D:\test.mxd", FileMode.Open); byte[] result = new byte[objFileStream.Length]; objFileStream.Read(result, 0, (int)objFileStream.Length); return result; } pElement = graphicsContainer.Next(); } } public void LoadMap(AxPageLayoutControl pageLayOut, byte[] result) { IGraphicsContainer graphicsContainer = pageLayoutTo2_3.GraphicsContainer; graphicsContainer.Reset(); IElement pElement = graphicsContainer.Next(); while (pElement != null) { if (pElement is IMapFrame) { System.IO.FileStream oFileStream = new System.IO.FileStream(@"D:\test.mxd", FileMode.Append); oFileStream.Write(result, 0, result.Length); IMapControl2 map = new MapControlClass(); map.LoadMxFile(@"D:\test.mxd", Type.Missing, Type.Missing ); IMapFrame frame = new MapFrameClass(); frame.Map = map.Map; pElement = (IElement)frame; pageLayOut.ActiveView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null); return; } pElement = graphicsContainer.Next(); } }
... View more
03-24-2013
05:12 PM
|
0
|
2
|
529
|
POST
|
This seems to be related to your question: http://support.esri.com/es/knowledgebase/techarticles/detail/32035 It is very useful. Thank you
... View more
03-24-2013
04:53 PM
|
0
|
0
|
214
|
POST
|
Hi, Are there anyone know how to convert IPersistStream or IStream object (in Arcgis) into MemoryStream or FileStream in C# ? Could you please give some codes for demo this ? Thanks and regards, Tai
... View more
03-22-2013
05:15 PM
|
0
|
2
|
2022
|
POST
|
you have some options:
ISegmentCollection segmentCollection = new PolygonClass();
segmentCollection.SetCircle(point, 10);
IGeometry circle = segmentCollection as IGeometry;
or you can cast the point to ITopologicalOperator and use buffer or you can rotate a vector from a center point or use EllipticArcClass and so on.. Thank you very much. I can do now 😄
... View more
03-18-2013
01:41 AM
|
0
|
0
|
380
|
POST
|
Hi, Are there anyone know how to draw the below circle using C# ? [ATTACH=CONFIG]22664[/ATTACH] Thanks and regards, Tai
... View more
03-15-2013
05:09 PM
|
0
|
2
|
3543
|
POST
|
Great ! It is successful now. Thanks Shuping very much ! Kind regards,
... View more
03-02-2013
01:39 AM
|
0
|
0
|
454
|
POST
|
Thanks Shuping, Yes, in my code, I didn't include line: pElement = graphicsContainer.Next(); in the while loop. In your code, you selected shapes of the pagelayout, right ? Is it ok if you add and select shapes within the Focus Map (MapFrame) of the pagelayout ? Kind regards,
... View more
02-21-2013
09:46 PM
|
0
|
0
|
454
|
POST
|
Hi, I am getting a problem: I added element (text, line) in a ActiveView.FocusMap of a PageLayoutControl, then all elements are showed in the MapFrame of PageLayoutControl.GraphicsContainer. If I don't select elements (in MapFrame) I can find the MapFrame by the loop: IGraphicsContainer graphicsContainer = myPageLayout.ActiveView.GraphicsContainer; graphicsContainer.Reset(); IElement pElement = graphicsContainer.Next(); while (pElement != null) { if (pElement is IMapFrame) { // do something } } But, when one element is selected by using "Select Elements" command, the program won't enter the "if" function (can't find MapFrame). Are there anyone know how to get The MapFrame in this case ? It's very urgent Thank you very much !
... View more
02-17-2013
11:04 PM
|
0
|
5
|
670
|
Title | Kudos | Posted |
---|---|---|
1 | 01-23-2014 05:34 PM |
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|