This is Khoa Ho's Typepad Profile.
Join Typepad and start following Khoa Ho's activity
Join Now!
Already a member? Sign In
Khoa Ho
Texas, USA
Founder of NetOnApp
Recent Activity
This is interesting. The equivalent SQLite query is: SELECT NominalDiameter, NominalUnit FROM Pipe_PNP WHERE EndType='PL' AND CompatibleStandard = 'ASME B36.19'
Thanks for the reply. I just played around with AutoCAD WS API and saw it does not expose many functionalities. It just mainly opens DWG files saved from the WebDav on the Flash-based client app. I think AutoCAD WS web service should does as strong as RealDWG WCF web service. Or we can build a new .NET platform porting from RealDWG to work as a service. RealDWG is slow and single-threaded that is not suitable for cloud computing. I guess the back-end code of AutoCAD WS is Java as I got error messages from Apache server. AutoCAD WS should be the new “cloud RealDWG”. Khoa
1 reply
Hi Kean, from last paragraphs of your article, it can say: "A new WinRT AutoCAD would be a window into a cloud service, where drawings are stored and manipulated away from the PC. You'd chose actions, see results, but the actual drawing processing would happen on cloud-scale systems." RealDWG will never be made available for WinRT, but it can be ported to pure .NET desktop to run as a web service on the cloud. It's interesting that AutoCAD future will be cloud-scale services. Khoa
1 reply
That is correct, the API will sync between drawing schema and database. But by learning what behind P&ID project, the actual mapping between database (SQLite or SQL server) and Project/Data Manager in Plant3d is helpful to understand how it works. Working directly with database instead of API is better for SQL Reporting Services.
This is my comments: DCF is SQLite database. If we open ProcessPower.dcf file, the table stores all those drawings is PnPDrawings, and the view is PnPDrawings_PNP. Since AutoCAD P&ID 2009, it already had table PnPDrawings, but it stores dummy data. The project drawing files are on PnIDPart.xml. But from P&ID 2013, this table has actual real drawing references, and strips all those project drawing files out of PnIDPart.xml. The benefit of database over XML is for multi-user connections. The API will call SQLite library to query data, so if we can use SQLite instead of AutoCAD P&ID API, it would be really more powerful.
Khoa Ho added a favorite at Through the Interface
Sep 7, 2012
Khoa Ho is now following Spiderinnet1
Aug 22, 2012
Thanks Stephen, I now understand why many apps on the Exchange Store have the same installation interface, as Autodesk has the Autoloader mechanism helping to create the installer. Otherwise developers have to make their own MSI packages and write to Windows registry info of the loader files. Phew, LOTS of good stuffs on the DevBlog to read recently! Thank you.
Toggle Commented Aug 17, 2012 on AutoCAD App ideas at AutoCAD DevBlog
Khoa Ho is now following Kean Walmsley
Aug 17, 2012
Hi Stephen, Can you have a tutorial showing how to create a msi installation file using Autodesk Plug-in Installer. Thank you.
Toggle Commented Aug 16, 2012 on AutoCAD App ideas at AutoCAD DevBlog
Thank you for your reply. The decompilers do not show the DllImport file (acad.exe, acdbxx.dll...) and EntryPoint, so we have to use other tools to find them out. It would be better to view all of those values on the decompiler. I chose Autodesk.AutoCAD.DatabaseServices.Database.ReadDwgFile() for my test, see the decompiled code: public unsafe void ReadDwgFile(IntPtr drawingFile, [MarshalAs(UnmanagedType.U1)] bool allowCPConversion, string password) { byte* ptr = password; if (ptr != null) { ptr = (ulong)RuntimeHelpers.OffsetToStringData + ptr; } Char modopt(System.Runtime.CompilerServices.IsConst)& char modopt(System.Runtime.CompilerServices.IsConst)& = ptr; Acad.ErrorStatus errorStatus = (Acad.ErrorStatus).AcDbDatabase.readDwgFile(this.GetImpObj(), (AcDwgFileHandle*)drawingFile.ToPointer(), allowCPConversion, char modopt(System.Runtime.CompilerServices.IsConst)&); if (errorStatus != (Acad.ErrorStatus)0) { throw new Exception((ErrorStatus)errorStatus); } } If I go futher to the wrapper of unmanaged code: .AcDbDatabase.readDwgFile(), see the following results from three compilers: ILSpy: [SuppressUnmanagedCodeSecurity] [DllImport("", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] [MethodImpl(MethodImplOptions.Unmanaged)] public unsafe static extern Acad.ErrorStatus readDwgFile(AcDbDatabase*, AcDwgFileHandle*, [MarshalAs(UnmanagedType.U1)] bool, char*); dotPeek: [SuppressUnmanagedCodeSecurity] [DllImport("", EntryPoint = "", CallingConvention = CallingConvention.Cdecl, SetLastError = true)] [MethodImpl(MethodImplOptions.Unmanaged, MethodCodeType = MethodCodeType.Native)] public static Acad.ErrorStatus AcDbDatabase\u002EreadDwgFile([In] AcDbDatabase* obj0, [In] char* obj1, [In] int obj2, [MarshalAs(UnmanagedType.U1)] bool _param4, [In] char* obj4) { // ISSUE: unable to decompile the method. } JustDecompile: [DllImport("", CharSet=CharSet.None)] [SuppressUnmanagedCodeSecurity] public static extern unsafe ErrorStatus modopt(System.Runtime.CompilerServices.CallConvCdecl) AcDbDatabase.readDwgFile(AcDbDatabase* modopt(System.Runtime.CompilerServices.IsConst) modopt(System.Runtime.CompilerServices.IsConst) , Char modopt(System.Runtime.CompilerServices.IsConst)* , Int32 modopt(System.Runtime.CompilerServices.IsConst) , bool , Char modopt(System.Runtime.CompilerServices.IsConst)* ); I see ILSpy has the best readable code. My RedGate Reflector was expired so I did not test it. Anyway, it is so fun to play with the decompiler. Thanks for your post.
Hi Stephen, I tried to use dotPeek, JustDecompile and ILSpy to decompile acmgd.dll and acdbmgd.dll. However, none of them can see exactly the implementation of class "Module", which is the core of all unmanaged code. So I don't know if those assembly files are partial obfuscated or not. How can I see the full implementation? Thank you.
This is also my big concern about PropertyName of dynamic blocks, see the thread: http://forums.autodesk.com/t5/NET/Dynamic-block-parameters-types/td-p/3569558
Excellent post! Nice work. Thank you.
Khoa Ho is now following Barbara Han
Aug 8, 2012
Khoa Ho is now following Augusto Goncalves
Aug 8, 2012
Khoa Ho is now following Fenton Webb
Aug 8, 2012
Khoa Ho is now following Daniel Du
Aug 8, 2012
Khoa Ho is now following Philippe Leefsma
Aug 8, 2012
Khoa Ho is now following Madhukar Moogala
Aug 8, 2012
Khoa Ho is now following The Typepad Team
Aug 8, 2012