To have a RibbonTextBox automatically update your data when the user updates the ribbon textbox and vice-versa, you can use the RibbonTextBox.TextValueBinding to establish a 2-way databinding. Here is a sample code :
As you might have heard, AutoCAD 2016 products has been released. Before we even say anything about new feature, here is the first questions we received: “Where can I get the final version of ObjectARX? There is no ARX on ADN…”
The "dumpallproperties" is an easy way to list all the properties of an entity using Lisp. Unfortunately, this does not work when used in the script file along with AccoreConsole. A simple way to workaround this and display the entity properties in AccoreConsole, is to create a CRX plugin that uses the Non-COM property system to display the entity properties.
Most of the code in this blog post is from a code snippet that my colleague Philippe Leefsma implemented. While his original code created an aligned dimension in paperspace, i have modified it slightly to create an ordinate dimension to cater to a recent developer request.
Here are the code snippets to create aligned and ordinate dimensions in paperspace while retaining their associativity with a reference point on an entity that is in modelspace.
The "AcDbDatabase::loadLineTypeFile" can load linetypes from a linetype file. If the linetype with the same name already exists in the database, then the loadLineTypeFile method can return an error code. A way to force the reloading of linetype is to load the linetype in another database and clone the linetype back to the host database to replace it. Here is a code snippet to do that :
For AccoreConsole to recognize a custom entity in your drawing, it requires to load the object enabler just as AutoCAD does. If you already know the full path of your object enabler (.dbx) you can have it configured for loading at startup by modifying the registry. Here is a sample registry file that would register the object enabler for AsdkPoly custom entity from the ObjectARX SDK :
if you do not know the full path to the dbx, you can have the "LOADER" path set as simply "asdkpolyobj.dbx". In that case, AccoreConsole would try searching for it alongside the AccoreConsole exe path, the drawing path or one of the support paths. An easy way to have the support path configured for AccoreConsole is to launch AutoCAD and add the custom path to its "support file search path" using the Options command. AccoreConsole uses the same set of search paths that is already setup in AutoCAD.
It is important to have the right application name of your object enabler written to the registry. A simple way to determine this is to list the entities in the drawing. AccoreConsole will display the details of the proxy object and its Application name as shown here :
For some reason, if you do not want AccoreConsole to load the object enablers, start AutoCAD and set the DEMANDLOAD to 0 and close it. Further invocation of AccoreConsole will stop loading the object enablers even when the dbx is configured for loading at startup using the registry. Please do not use this unless you have a reason to do so. This may cause other issues as object enablers that AutoCAD requires for its working can also get ignored.
Oculus Rift DK2 provides a great virtual reality experience that is very immersive. In this blog post, I have attached a sample project that enables viewing solids from the drawing database for viewing in Oculus Rift. The code makes use of helper methods from the "Win32_DX11AppUtil" of the "OculusRoomTiny" sample which is included in the Oculus SDK. Some of the helper methods have also been modified to extend it for AutoCAD solids. Here is a short video before we look at the sample code.
Here is the relevant code snippet that renders the view. The full sample project can be downloaded here : Download OVRAutoCADSolids
gpDX11 = new DirectX11();
// Initializes LibOVR, and the Rift
ovrBool ovrInitialized = ovr_Initialize();
HMD = ovrHmd_Create(0);
MessageBoxA(NULL,"Oculus Rift not detected." ,"" , MB_OK);