{"id":19658,"date":"2025-03-23T15:51:27","date_gmt":"2025-03-23T07:51:27","guid":{"rendered":"https:\/\/blog.iyatt.com\/?p=19658"},"modified":"2025-03-23T15:51:27","modified_gmt":"2025-03-23T07:51:27","slug":"objectarx-2025%ef%bc%88c%ef%bc%89%e7%bb%98%e5%88%b6%e6%a4%ad%e5%9c%86-acdbellipse","status":"publish","type":"post","link":"https:\/\/blog.iyatt.com\/?p=19658","title":{"rendered":"ObjectARX 2025\uff08C++\uff09\u7ed8\u5236\u692d\u5706 AcDbEllipse"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 ez-toc-wrap-center counter-hierarchy ez-toc-counter ez-toc-light-blue ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title ez-toc-toggle\" style=\"cursor:pointer\">\u76ee\u5f55<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/blog.iyatt.com\/?p=19658\/#%E7%8E%AF%E5%A2%83\" >\u73af\u5883<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/blog.iyatt.com\/?p=19658\/#%E5%AE%9E%E7%8E%B0\" >\u5b9e\u73b0<\/a><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E7%8E%AF%E5%A2%83\"><\/span>\u73af\u5883<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>AutoCAD \u673a\u68b0\u7248 2025<br \/>\nObjectARX 2025<br \/>\nVS 2022\uff08ISO C++14\uff09<\/p>\n<p>\u73af\u5883\u914d\u7f6e\u53c2\u8003\uff1a<a href=\"https:\/\/blog.iyatt.com\/?p=16480\">https:\/\/blog.iyatt.com\/?p=16480<\/a><\/p>\n<h1><span class=\"ez-toc-section\" id=\"%E5%AE%9E%E7%8E%B0\"><\/span>\u5b9e\u73b0<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<p>Ellipse.hpp<\/p>\n<pre><code class=\"language-cpp\">#pragma once\nclass Ellipse\n{\npublic:\n    static void work();\n\nprivate:\n    static void drawEllipse(AcDbEllipse* pEllipseObj);\n};<\/code><\/pre>\n<p>Ellipse.cpp<\/p>\n<pre><code class=\"language-cpp\">#include &quot;stdafx.h&quot;\n#include &quot;Ellipse.hpp&quot;\n\nvoid Ellipse::drawEllipse(AcDbEllipse * pEllipseObj)\n{\n    AcDbBlockTable* pBlockTable = nullptr;\n    acdbHostApplicationServices()-&gt;workingDatabase()-&gt;getBlockTable(pBlockTable, AcDb::kForRead);\n    AcDbBlockTableRecord* pBlockTableRecord = nullptr;\n    pBlockTable-&gt;getAt(ACDB_MODEL_SPACE, pBlockTableRecord, AcDb::kForWrite);\n    pBlockTableRecord-&gt;appendAcDbEntity(pEllipseObj);\n    pBlockTableRecord-&gt;close();\n    pBlockTable-&gt;close();\n}\n\nvoid Ellipse::work()\n{\n    const AcGePoint3d center(10, 0, 0); \/\/ \u4e2d\u5fc3\n    const AcGeVector3d normal(0, 0, 1); \/\/ xy\u5e73\u9762\u5411\u91cf\n    const AcGeVector3d majorAxis(50, 0, 0); \/\/ \u957f\u534a\u8f74\u77e2\u91cf\n    const double radiusRation = 0.5; \/\/ \u77ed\u8f74\u548c\u957f\u8f74\u7684\u6bd4\u503c\n    AcDbEllipse* pEllipseObj = new AcDbEllipse(center, normal, majorAxis, radiusRation);\n    Ellipse::drawEllipse(pEllipseObj);\n    pEllipseObj-&gt;close();\n}<\/code><\/pre>\n<p>\u5728 acrxEntryPoint.cpp \u4e2d\u5f15\u7528\u5934\u6587\u4ef6\uff0c\u5e76\u5728 On_kInitAppMsg \u65b9\u6cd5\u91cc\u8c03\u7528<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/03\/image-1742716180966.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1004px; --smush-placeholder-aspect-ratio: 1004\/586;\" \/><\/p>\n<p>\u8c03\u8bd5\u8fd0\u884c<br \/>\n<img decoding=\"async\" data-src=\"https:\/\/blog.iyatt.com\/wp-content\/uploads\/2025\/03\/image-1742716265744.png\" alt=\"file\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" class=\"lazyload\" style=\"--smush-placeholder-width: 1141px; --smush-placeholder-aspect-ratio: 1141\/685;\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u73af\u5883 AutoCAD \u673a\u68b0\u7248 2025 ObjectARX 2025 VS 2022\uff08ISO C++14\uff09 \u73af [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"zakra_page_container_layout":"customizer","zakra_page_sidebar_layout":"customizer","zakra_remove_content_margin":false,"zakra_sidebar":"customizer","zakra_transparent_header":"customizer","zakra_logo":0,"zakra_main_header_style":"default","zakra_menu_item_color":"","zakra_menu_item_hover_color":"","zakra_menu_item_active_color":"","zakra_menu_active_style":"","zakra_page_header":true,"_lmt_disableupdate":"no","_lmt_disable":"no","footnotes":""},"categories":[1,616,589,618,621],"tags":[],"class_list":["post-19658","post","type-post","status-publish","format-standard","hentry","category-all","category-autocad","category-c-c","category-cad-cam","category-objectarx"],"modified_by":"IYATT-yx","_links":{"self":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/19658","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=19658"}],"version-history":[{"count":2,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/19658\/revisions"}],"predecessor-version":[{"id":19662,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=\/wp\/v2\/posts\/19658\/revisions\/19662"}],"wp:attachment":[{"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=19658"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=19658"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.iyatt.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=19658"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}