/////////////////////////////////////////////////////////////////////////////// // Copyright (C) 2002-2025, Open Design Alliance (the "Alliance"). // All rights reserved. // // This software and its documentation and related materials are owned by // the Alliance. The software may only be incorporated into application // programs owned by members of the Alliance, subject to a signed // Membership Agreement and Supplemental Software License Agreement with the // Alliance. The structure and organization of this software are the valuable // trade secrets of the Alliance and its suppliers. The software is also // protected by copyright law and international treaty provisions. Application // programs incorporating this software must include the following statement // with their copyright notices: // // This application incorporates Open Design Alliance software pursuant to a license // agreement with Open Design Alliance. // Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance. // All rights reserved. // // By use of this software, its documentation or related materials, you // acknowledge and accept the above terms. /////////////////////////////////////////////////////////////////////////////// #pragma once #include "DbAssocActionBody.h" //A simple example of an association body class that adds a line between 2 anchor points to other objects //It is also possible to control the “solid” parameter to display the line in the form of a pipe class OdAssocLineExampleActionBody : public OdDbAssocActionBody { static const int kVersion; public: ODDB_DECLARE_MEMBERS(OdAssocLineExampleActionBody); OdAssocLineExampleActionBody(); virtual ~OdAssocLineExampleActionBody(); virtual OdResult dwgInFields(OdDbDwgFiler* pFiler) override; virtual void dwgOutFields(OdDbDwgFiler* pFiler) const override; //The main function to start working with an object is the entry point when the association is changed virtual void evaluateOverride() override; static int getVersion(); void setBlockRefId(OdDbObjectId blockRefId) { m_blockRefId = blockRefId; } static OdResult createBlockRef(OdDbDatabasePtr pDb, OdDbObjectId BTRId, OdDbObjectId& blockRefId, OdDbObjectId& lineId); //Static method to create the entire association (action and all internal objects) static OdResult createInstance( const OdDbFullSubentPathArray entPathArray, const OdGePoint3dArray& ptsSelected, const OdArray& snapModeArr, OdDbObjectId& blockRefId, OdDbObjectId& actionBodyId); protected: OdResult evaluateLine(); OdDbObjectId m_blockRefId; }; typedef OdSmartPtr OdAssocLineExampleActionBodyPtr;