<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Custom Object inherits from AcDbBlockTableRecord in ObjectARX Forum</title>
    <link>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12135049#M1579</link>
    <description>Yes, according to what you said, the problem has been resolved yet.</description>
    <pubDate>Sat, 29 Jul 2023 07:10:24 GMT</pubDate>
    <dc:creator>dziwve67853</dc:creator>
    <dc:date>2023-07-29T07:10:24Z</dc:date>
    <item>
      <title>Custom Object inherits from AcDbBlockTableRecord</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12133647#M1577</link>
      <description>&lt;P&gt;I created a custom object that inherits from AcDbBlockTableRecord. I use it to create a block definition '111' and save it as a dwg file. When I open this dwg without loading arx, I will be prompted to repair the file.How can solve this problem?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-07-28_220940.png" style="width: 631px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1246430i7F209339FEC7C8E6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-07-28_220940.png" alt="2023-07-28_220940.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class DLLIMPEXP YJBlkDef : public AcDbBlockTableRecord {&lt;BR /&gt;&lt;BR /&gt;public:&lt;BR /&gt;ACRX_DECLARE_MEMBERS(YJBlkDef) ;&lt;/P&gt;&lt;P&gt;protected:&lt;BR /&gt;static Adesk::UInt32 kCurrentVersionNumber ;&lt;/P&gt;&lt;P&gt;public:&lt;BR /&gt;YJBlkDef () ;&lt;BR /&gt;virtual ~YJBlkDef () ;&lt;/P&gt;&lt;P&gt;//----- AcDbObject protocols&lt;BR /&gt;//- Dwg Filing protocol&lt;BR /&gt;virtual Acad::ErrorStatus dwgOutFields (AcDbDwgFiler *pFiler) const ;&lt;BR /&gt;virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler *pFiler) ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;} ;&lt;/P&gt;&lt;P&gt;#ifdef YJENTITY_MODULE&lt;BR /&gt;ACDB_REGISTER_OBJECT_ENTRY_AUTO(YJBlkDef)&lt;BR /&gt;#endif&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#include "StdAfx.h"&lt;BR /&gt;#include "YJBlkDef.h"&lt;/P&gt;&lt;P&gt;//-----------------------------------------------------------------------------&lt;BR /&gt;Adesk::UInt32 YJBlkDef::kCurrentVersionNumber =1 ;&lt;/P&gt;&lt;P&gt;//-----------------------------------------------------------------------------&lt;BR /&gt;ACRX_DXF_DEFINE_MEMBERS (&lt;BR /&gt;YJBlkDef, AcDbBlockTableRecord,&lt;BR /&gt;AcDb::kDHL_CURRENT, AcDb::kMReleaseCurrent,&lt;BR /&gt;AcDbProxyEntity::kNoOperation, YJBLKDEF,&lt;BR /&gt;YTMYJENTITYAPP&lt;BR /&gt;|Product Desc: A description for your object&lt;BR /&gt;|Company: Your company name&lt;BR /&gt;|WEB Address: Your company WEB site address&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;//-----------------------------------------------------------------------------&lt;BR /&gt;YJBlkDef::YJBlkDef () : AcDbBlockTableRecord () {&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;YJBlkDef::~YJBlkDef () {&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;//-----------------------------------------------------------------------------&lt;BR /&gt;//----- AcDbObject protocols&lt;BR /&gt;//- Dwg Filing protocol&lt;BR /&gt;Acad::ErrorStatus YJBlkDef::dwgOutFields (AcDbDwgFiler *pFiler) const {&lt;BR /&gt;assertReadEnabled () ;&lt;BR /&gt;//----- Save parent class information first.&lt;BR /&gt;Acad::ErrorStatus es =AcDbObject::dwgOutFields (pFiler) ;&lt;BR /&gt;if ( es != Acad::eOk )&lt;BR /&gt;return (es) ;&lt;BR /&gt;//----- Object version number needs to be saved first&lt;BR /&gt;if ( (es =pFiler-&amp;gt;writeUInt32 (YJBlkDef::kCurrentVersionNumber)) != Acad::eOk )&lt;BR /&gt;return (es) ;&lt;BR /&gt;//----- Output params&lt;BR /&gt;//.....&lt;BR /&gt;es = __super::dwgOutFields(pFiler);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;return (pFiler-&amp;gt;filerStatus ()) ;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;Acad::ErrorStatus YJBlkDef::dwgInFields (AcDbDwgFiler *pFiler) {&lt;BR /&gt;assertWriteEnabled () ;&lt;BR /&gt;//----- Read parent class information first.&lt;BR /&gt;Acad::ErrorStatus es =AcDbObject::dwgInFields (pFiler) ;&lt;BR /&gt;if ( es != Acad::eOk )&lt;BR /&gt;return (es) ;&lt;BR /&gt;//----- Object version number needs to be read first&lt;BR /&gt;Adesk::UInt32 version =0 ;&lt;BR /&gt;if ( (es =pFiler-&amp;gt;readUInt32 (&amp;amp;version)) != Acad::eOk )&lt;BR /&gt;return (es) ;&lt;BR /&gt;if ( version &amp;gt; YJBlkDef::kCurrentVersionNumber )&lt;BR /&gt;return (Acad::eMakeMeProxy) ;&lt;BR /&gt;//- Uncomment the 2 following lines if your current object implementation cannot&lt;BR /&gt;//- support previous version of that object.&lt;BR /&gt;//if ( version &amp;lt; YJBlkDef::kCurrentVersionNumber )&lt;BR /&gt;// return (Acad::eMakeMeProxy) ;&lt;BR /&gt;//----- Read params&lt;BR /&gt;//.....&lt;BR /&gt;es = __super::dwgInFields(pFiler);&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;return (pFiler-&amp;gt;filerStatus ()) ;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;static void YTMYJEntityMyCommand1(void)&lt;BR /&gt;{&lt;BR /&gt;// Add your code for command YTMYJEntity.MyCommand1 here&lt;/P&gt;&lt;P&gt;Acad::ErrorStatus es;&lt;BR /&gt;AcDbBlockTable *pBlkTbl = NULL;&lt;BR /&gt;acdbCurDwg()-&amp;gt;getBlockTable(pBlkTbl, AcDb::kForWrite);&lt;/P&gt;&lt;P&gt;YJBlkDef *pBlkTblRcd = new YJBlkDef();&lt;BR /&gt;pBlkTblRcd-&amp;gt;setName(_T("111"));AcDbObjectId blkDefId;&lt;BR /&gt;es = pBlkTbl-&amp;gt;add(blkDefId, pBlkTblRcd);&lt;BR /&gt;pBlkTbl-&amp;gt;close();&lt;BR /&gt;if(Acad::eOk !=es)&lt;BR /&gt;{&lt;BR /&gt;acutPrintf(_T("\nAdd error！"));&lt;BR /&gt;delete pBlkTblRcd;return;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;std::vector&amp;lt;AcDbEntity*&amp;gt; pEnts;&lt;BR /&gt;{&lt;BR /&gt;AcDbLine* pLine = new AcDbLine(AcGePoint3d(0,0,0),AcGePoint3d(10,10,0));&lt;BR /&gt;pEnts.push_back(pLine);&lt;/P&gt;&lt;P&gt;AcDbCircle* pCilrcle = new AcDbCircle(AcGePoint3d(5,5,0),AcGeVector3d::kZAxis,3);&lt;BR /&gt;pCilrcle-&amp;gt;setColorIndex(3);&lt;BR /&gt;pEnts.push_back(pCilrcle);&lt;BR /&gt;}&lt;BR /&gt;for(int i=0;i&amp;lt;pEnts.size();i++)&lt;BR /&gt;{&lt;BR /&gt;AcDbObjectId entId;&lt;BR /&gt;es =pBlkTblRcd-&amp;gt;appendAcDbEntity(entId, pEnts.at(i));&lt;BR /&gt;if (es != Acad::eOk)&lt;BR /&gt;{&lt;BR /&gt;acutPrintf(_T("\nError！"));&lt;BR /&gt;delete pEnts.at(i);&amp;nbsp;&lt;BR /&gt;continue;&lt;BR /&gt;}&lt;BR /&gt;pEnts.at(i)-&amp;gt;close();&lt;BR /&gt;}&lt;BR /&gt;pBlkTblRcd-&amp;gt;close();&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;AcDbBlockReference *pBlkRef = new AcDbBlockReference(AcGePoint3d(20,20,0), blkDefId);&lt;BR /&gt;PostToModelSpace(pBlkRef);&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/845950"&gt;@tbrammer&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jul 2023 14:21:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12133647#M1577</guid>
      <dc:creator>dziwve67853</dc:creator>
      <dc:date>2023-07-28T14:21:13Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Object inherits from AcDbBlockTableRecord</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12134737#M1578</link>
      <description>&lt;P&gt;just an observation, but shouldn't the filer be AcDbBlockTableRecord::dwgInFields? since AcDbObject is not the parent&lt;/P&gt;</description>
      <pubDate>Sat, 29 Jul 2023 00:42:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12134737#M1578</guid>
      <dc:creator>daniel_cadext</dc:creator>
      <dc:date>2023-07-29T00:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: Custom Object inherits from AcDbBlockTableRecord</title>
      <link>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12135049#M1579</link>
      <description>Yes, according to what you said, the problem has been resolved yet.</description>
      <pubDate>Sat, 29 Jul 2023 07:10:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/objectarx-forum/custom-object-inherits-from-acdbblocktablerecord/m-p/12135049#M1579</guid>
      <dc:creator>dziwve67853</dc:creator>
      <dc:date>2023-07-29T07:10:24Z</dc:date>
    </item>
  </channel>
</rss>

