I have just upgraded from v6.0 to v7.0 of MapSuite Desktop Edition by downloading from My Purchased Products and thought it would be good to tryout the new CAD support. Unfortunately I cannot see the CadFeatureLayer as mentioned in the example Source Code ServicesEditionSample CADFile CS 130726.zip. I expect I have overlooked something but would be grateful if you could point me in the right direction.
Also any pointers on any limitations of this new layer might be helpful.
Regards,
Jonathan
CAD FeatureLayer in Desktop Edition
Hi Jonathan,
Thanks for you focus in CAD feature!
I guess you didn’t find the class is because you are using the production version, switching to the development version(7.0.46.0 or later) should be fine. Please note: in order to make the sample work fine, Setup Unmanaged Dependencies 7.0.46.0 or later also needs to be installed.
As for the production version, it will support this feature in the next release(map suite 8.0) as soon as the feature goes well in current development version. Hope you will have a good practice on CAD feature and we appreciate any advices!
Hope it helps and if any question, don’t hesitate to let us know.
Thanks,
Troy
Troy,
Thanks - I’ll download and give it a go.
Regards,
Jonathan
Thanks for the help - the CAD Feature Layer is working OK now and I have successfully loaded up a few DWG and DXF files, however I do have a problem with a couple of CAD files. What happens is that the application appears to hang for a few minutes and then reports the following exception:
System.Reflection.TargetInvocationException was unhandled
HResult=-2146232828
Message=Exception has been thrown by the target of an invocation.
Source=mscorlib
StackTrace:
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
at ThinkGeo.MapSuite.Core.CadFeatureSource.Sjs=(String Szs=)
at ThinkGeo.MapSuite.Core.CadFeatureSource.STs=()
at ThinkGeo.MapSuite.Core.CadFeatureLayer.DrawCore(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.Core.Layer.Draw(GeoCanvas canvas, Collection`1 labelsInAllLayers)
at ThinkGeo.MapSuite.DesktopEdition.LayerOverlay.DrawCore(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.qhM=(GeoCanvas qxM=)
at ThinkGeo.MapSuite.DesktopEdition.Overlay.Draw(GeoCanvas canvas)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.bxU=(IEnumerable`1 cBU=, RectangleShape cRU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.bBU=(RectangleShape bRU=, RectangleShape bhU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.vBU=(RectangleShape vRU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.thU=(Int32 txU=, RectangleShape uBU=)
at ThinkGeo.MapSuite.DesktopEdition.WinformsMap.Refresh()
at PTSimpleMapper.clsProjectSupport.refreshAllOverlays(WinformsMap& theMap) in c:\Users\Jonathan\Documents\Visual Studio 2013\Projects\simpleMapper\simpleMapper\MapProject\clsProjectSupport.cs:line 415
at PTSimpleMapper.frmMap.LoadMapWithCAD(PointShape parishCentre, Double desiredZoom, String serverConnection) in c:\Users\Jonathan\Documents\Visual Studio 2013\Projects\simpleMapper\simpleMapper\Forms and Dialogs\frmMap.cs:line 165
at PTSimpleMapper.frmMap.setFeatureMap(featureTypes newFeatureType) in c:\Users\Jonathan\Documents\Visual Studio 2013\Projects\simpleMapper\simpleMapper\Forms and Dialogs\frmMap.cs:line 518
at PTSimpleMapper.frmMap.frmMap_Load(Object sender, EventArgs e) in c:\Users\Jonathan\Documents\Visual Studio 2013\Projects\simpleMapper\simpleMapper\Forms and Dialogs\frmMap.cs:line 471
at System.Windows.Forms.Form.OnLoad(EventArgs e)
at System.Windows.Forms.Form.OnCreateControl()
at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)
at System.Windows.Forms.Control.CreateControl()
at System.Windows.Forms.Control.WmShowWindow(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WmShowWindow(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.SendMessage(HandleRef hWnd, Int32 msg, Int32 wParam, Int32 lParam)
at System.Windows.Forms.Form.SetVisibleCore(Boolean value)
at System.Windows.Forms.Control.set_Visible(Boolean value)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at PTSimpleMapper.Program.Main() in c:\Users\Jonathan\Documents\Visual Studio 2013\Projects\simpleMapper\simpleMapper\Program.cs:line 18
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException: GisSharpBlog.NetTopologySuite.Geometries.TopologyException
HResult=-2146232832
Message=side location conflict [ (478876.03125, 135426.330084263, NaN) ]
Source=CadDumperX86
StackTrace:
at ohM=.fBQ=.ghQ=()
at ohM=.fBQ=.gRQ=()
at CadDumper.CadDumper.GetCadFeatures()
InnerException:
Does this mean that there are some feature types in the CAD file that cannot be understood or possibly have an invalid geometry? Or might there be some other type of problem?
Regards,
Jonathan
P.S. If you would like a copy of the DWG file then I will need to check that I can send it - so probably not before early next week.
Hello Jonathan,
Based on the exception message, yes it seems like there are some invalid geometries. In order to figure out what’s the exact one, your DWG file still be needed to debug I am afraid.
Thanks,
Troy
Troy,
Thank you for the reply, If it is OK with you? I will hopefully be able to send the file up later this morning (UK time).
Regards,
Jonathan
Please find attached a zipped DWG file that causes the error mentioned earlier. I hope this is OK and that it helps us understand why the problem occurs.
Regards,
Jonathan
Hi Jonathan,
Thanks for your file and sorry for the waiting.
We can recreate your issue easily but the issue throws from a third-party library which the CAD layer refers to. So, we want you know the status that we are working on it but I am afraid we need some days on it.
If any updates, I will update here.
Thanks for your understanding.
Regards,
Troy
Troy,
Thank you for the update and I appreciate your efforts investigating this problem.
Regards,
Jonathan
Hi Jonathan,
It’s proved a bug and we have fixed in the latest version(7.0.230.0), please get the dll package and just install the “Map Suite Unmanaged Dependencies 7.0.230.0.msi” (the version might be building, please waiting for some days).
If everything goes well, you should can get the result like the below:
If the issue persists, don’t hesitate to let us know.
Regards,
Troy
Troy,
Thank you, I will look out for that build and test as soon as I get it.
Regards,
Jonathan
Jonathan,
Ok, hope it also works in your end.
Thanks,
Troy
Troy,
I noticed that Version 7.0.0231 was available so attempted to download but unfortunately the zip file had a number of errors and did not unzip fully. I did try the evaluation daily build and, whilst that download fine, it wasn’t really suitable as I get a ‘trial period expired’ message. However since the evaluation download and unzipped OK I suspect that there is a problem with the production daily build.
Regards,
Jonathan
Hi Jonathan,
Yes, seems the production package of 7.0.0.231 have broken in our daily build, would you please waiting for the next version and then have a try.
Sorry for the inconvenience.
Troy
Troy,
This morning I looked again for an update and found DesktopEditionFull7.0.234.0DllPackage.zip. So I decided to give the fix another try; this time it unzipped fine, but, unfortunately I still got exactly the same error when trying to open the troublesome CAD file. Might the fix have been accidentally removed between builds or might I be doing something not quite right?
Regards,
Jonathan
Hi Jonathan,
I have verified the latest unmanaged dependency is not updated in the latest build. We have contact the build team to do this update, and it will be done very soon. We will update this thread when it is ready. Sorry for the inconvenience.
Thanks,
Howard
Hi Jonathan,
Thanks for your patient. The unmanaged dependency is updated since version 7.0.239.0. Please feel free to get this or newer version and try.
Thanks,
Howard
Howard,
Thanks for the update. We appear to have 7.0.238.0 available to download at the moment so I will watch for the new version.
Regards,
Jonathan
Jonathan,
Okay, feel free to let me know if you have more queries.
Thanks,
Howard
Hi,
I noticed the version 240 was available so gave the fix a try and it looked good - thanks. Unfortunately I have found another DWG file that doesn’t open correctly; this time there are no crashes however only a small number of features are displayed when a great any more were expected.
Would it be OK to send this one for checking? (It is about 3000 KB zipped up)
Regards,
Jonathan