Is is possible to use RealDwg to render dwg elements to meshes?

Is is possible to use RealDwg to render dwg elements to meshes?

peter_grahamS69E6
Community Visitor Community Visitor
82 Views
2 Replies
Message 1 of 3

Is is possible to use RealDwg to render dwg elements to meshes?

peter_grahamS69E6
Community Visitor
Community Visitor

We want to use RealDWG to turn a dwg into meshes for our application and struggling to get something working.

We're trying to use RealDDWG to import dwgs as meshes into our application. We've tried getting a rendering pipeline working using AcDbEntity::worldDraw but it's failing because RealDWG is expecting a AcGiContextImp to be set, but we can't find a way to set that. Is this something that RealDWG can do?

Thanks,
Peter

0 Likes
83 Views
2 Replies
Replies (2)
Message 2 of 3

Radwan-Almsora
Explorer
Explorer

Yes, it is possible to process DWG elements into meshes with RealDWG, but it requires a specific pipeline. Because RealDWG acts as an OEM toolkit running without an active AutoCAD host, it does not support native screen graphics or interactive rendering.

 

The error you are facing with AcGiContextImp and worldDraw is expected behavior in this environment.The Problem with worldDrawThe AcGiContextImp class is an internal AutoCAD implementation used by AcGiContext (the Graphics Interface Context) to establish a rendering pipeline or to draw entities directly to the screen. Because RealDWG does not provide access to the AutoCAD display host, it intentionally restricts functions that rely on UI, display, or interactive rendering. Attempting to call worldDraw directly forces the library to look for an AutoCAD GUI context, which is missing in a standalone RealDWG application.The Solution: Use subWorldDraw or TessellationInstead of relying on the rendering pipeline to draw to an active display, your RealDWG application should parse the native CAD entities and manually extract the mesh geometry using the base API classes.

0 Likes
Message 3 of 3

norman.yuan
Mentor
Mentor

RealDWG itself HAS NOTHING to do with rendering/visualizing data stored in DWG file. It is all about translate data stored in DWG file into a database in memory as runtime objects that AutoCAD can understand (so that AutoCAD can render them visually and allow users to manipulate these objects). 

 

If you want to render data in DWG file, you must use an application that understand the binary/propriety data in DWG file to read data in DWG file, that is where RealDWG comes in (unless you use AutoCAD, which has everything RealDWG stands for built-in). So, you either use AutoCAD (desktop/web) to render/show data in DWG File, or you build your own "AutoCAD" for rendering DWG data in your own way (hopefully, you have long enough time and rich enough resources to do that).

 

For what reasons you want to rendering some data in DWG file with RealDwg (thus not using AutoCAD)? Or you simply do not want to use desktop AutoCAD because of your targeted app users not having AutoCAD installed? In this case, you may want to use Autodesk's cloud services (Platform Services) to process the DWG file to only collect certain types of objects (in your case, the meshes) and send the data to Autodesk's online viewer.

 

Norman Yuan

Drive CAD With Code

EESignature

0 Likes