Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • DrawCirclesCommand

  • CustomEntity

  • CreateText

  • DrawTemporaryEntities

  • SelectObjects

  • DocumentCommands

  • GetClosestOsnap

  • DatabaseReactor

  • DrawableOverrule

  • DrawLinesCommand

Note: Additional samples will be included in further updates.

Module

Short Description

DrawCirclesCommand

The sample DrawCirclesCommand introduces the most important technique: the command. A command name must be unique and can be executed by runCommand(). The command (DrawCircleCommand) shows how to access the document database, invoke user prompts and create entities using a custom tracker (CDrawCircleTracker). For more details please also check the comments in the source and header files.

CustomEntity

The sample SpecialEntity demonstrates how a custom entity is created,registered and used. The custom entity inherits from base class OdDbCircle and is transformed visually by overwriting the entity's subWorldDraw() method. For more details please also check the comments in the source and header files.

CreateText

Coming soon …

DrawTemporaryEntities

Coming soon …

SelectObjects

Coming soon …

DocumentCommands

Coming soon …

GetClosestOsnap

Coming soon …

The sample CreateText creates a new OdDbText and appends it to the active documents database.

DrawTemporaryEntities

The sample DrawTemporaryEntities creates, installs and operates with a CFxTracker. The tracker renders geometry without the need adding entities to the database.

SelectObjects

The sample SelectObjects shows how to let the user select entities with methods like DoSSGet(), manually select entities by layer name or type, and work with a CFxSelectionSet.

DocumentCommands

The sample DocumentCommands has custom commands to close or save the active document. Closing the active document can be achieved with method CloseDocument() from CFxDocumentManager. Saving the file can be done with method SaveFile() from OdDbDatabase.

GetClosestOsnap

The sample GetClosestOsnap shows how to access entities osnap points using getOsnapPoints() and analyzes the closest osnap point to a specified location.

DatabaseReactor

The sample DatabaseReactor emphasizes all necessary steps to register a DbDatabaseReactor database reactor to the active documents database. This database reactor will inform about all database transactions like objectAppended() or objectErased().

DrawableOverule

A OdGiDrawableOverrule is a nice way to specify how a certain entity type will be rendered. A overrule will be processed only once ( or run rebuild ) except you specify OdGiDrawable::kDrawableRegenDraw as overrule attribute; this will redraw all necessary enttiy types any time the view changes. This approach might be useful if you want to apply a special scaling.

DrawLinesCommand

The sample DrawLinesCommand shows how to develop a command that inserts a line with continuous segments. It also explains how to assign a linetype to a temporary entity. Important: Linetypes must be available as assets. Load module with odrxDynamicLinker()->loadApp( L"DrawLinesCommand" );

image-20240613-103235.pngImage Added

C++ Modules - OdRxModule and CFxCommand
This is a short summary about how a C++ module can be created, compiled and loaded into the host appliaction. All necessary steps are based on DrawCirclesCommand.

  1. Java: Create a nativ method

  2. C++: Create a matching implementation

  3. Store the C++ implementation inside a shared library

  4. Create C++ module

  5. Load C++ module

  6. Compile the shared library and module with CMake

  7. Load the shared library with System.LoadLibrary()

  8. Call native method to load C++ module inside Java host application

1. C++ Modules - Java: Create a nativ method

...