Articles and Press Releases

Creating Custom Objects in IntelliCAD

One of the most powerful features of the IntelliCAD development platform is the ability to create custom entities (also known as custom objects). Developers can define the behavior of custom entities which can greatly improve the user’s experience, enhancing productivity.

How can custom entities improve your user’s CAD experience? Let’s use the example of drawing a floor plan to explain. When drafting a floor plan using primitives (lines, arcs, circles) a user will combine these primitives to make a door shape or block that can be used throughout the drawing. If a new door size is required then the shapes have to be redrawn from scratch. Lines are used to draw walls and must be manually trimmed; if a wall’s angle is changed all the door shapes have to be manually realigned with the wall lines.

However, an application developer can define custom entities for walls, doors and windows. Since you define the behavior of these entity types you can define their name, how they are inserted, how they scale, are mirrored, their properties and how they interact with other entities — either primitives or additional custom entities. You can create the door object with properties such as width and height (common terminology for doors), and define the behavior of how doors will work when those properties change and how they relate to the environment.

For example, doors need to be not only inserted into a wall but also need to create break lines on the wall itself. Then when the door is moved, the wall needs to rebuild and create a new hole in the new position. The custom door entity can be defined to allow the swing to flip, not to mention changing the width or height of the door itself. When the door is copied and pasted does it stick within the wall or is a freestanding door allowed within the drawing? Is it possible to allow regular CAD editing commands (move, copy, trim, extend, stretch) to interact with the custom door entity? Also the developer can define what the custom entity will look like in different views: 2D plan, elevation and 3D view.

What is important to note here is that custom objects allow the programmer to not only define the appearance, properties and associated data of the object but also to define its behavior in relation to its environment and likewise the environment in relation to the object. This ability to create behavior and use terminology that is familiar to the target user greatly improves user productivity. The complexity of a custom object really is up to the programmer but they should consider:
• How the entity is saved in the .dwg file
• How the graphics and geometry are displayed in both the viewports and 2D/3D world environments
• The names of properties and the behavior when those properties change
• How the entity works with various snap modes
• How many grip points will be available and how they behave
• How the entity intersects with the other entities in the drawing
• What happens when the entity is exploded or viewed in other programs
• What relationships the entity may have with other entities in the drawing
• How the entity displays and behaves when your application is not present

Developers define the behavior of their custom entities in application extension DLLs, but you can also define some basic behavior for your entities when your application DLL is not present. Developers can define proxy graphics and determine if some basic editing (like copy or move) can be done without their application. However, in the case of a door entity it would be impossible for it to resize properly when the properties where changed or to automatically update walls if the underlying application was missing. The proxy functionality only allows your .dwg files that contain custom entities to have some basic behavior when loaded in other CAD applications. Then again, if you choose to force the user to purchase your application you can disable all proxy functionality so the custom entities are useless without your underlying application.

To get the full behavior of a custom entity, the underlying application DLL needs to be loaded within IntelliCAD prior to opening a drawing that contains custom entities. This can be done either manually [via the APPLOAD command] or automatically when the IntelliCAD program starts [by dropping the IRX file into the IntelliCAD program folder].

The IntelliCAD API provides a simple sample application that demonstrates the power of custom entities. The API installation files are usually shipped with the IntelliCAD program but can also be found on the IntelliCAD beta forum. The following movie shows how to load, install, and experiment with the sample custom entity application included within the IntelliCAD API:

The sample discussed here is included in the API samples and documentation. Although the source code is available to build the application from scratch, the IRX DLL release version is also prebuilt and waiting for you to load it.

If you are a developer interested in using the IntelliCAD platform please contact Robert Berry via Skype at Robert.Berry.ITC and apply for access to our beta forum so that you can test the software for yourself.

Topics: IntelliCAD BIM DWG IntelliCAD® 7 CAD programming ARX IRX custom objects custom entities