{"id":1002,"date":"2024-07-02T07:51:36","date_gmt":"2024-07-01T23:51:36","guid":{"rendered":"http:\/\/www.wyrcad.com\/?p=1002"},"modified":"2024-07-04T10:33:18","modified_gmt":"2024-07-04T02:33:18","slug":"autocad-%e8%a1%a8%e7%9a%84%e6%93%8d%e4%bd%9c","status":"publish","type":"post","link":"https:\/\/www.wyrcad.com\/?p=1002","title":{"rendered":"AutoCAD \u7684\u8868(Table)"},"content":{"rendered":"\n<p>\u2018\u7ed1\u5b9a AutoCAD<br>Dim I As Integer, J As Integer<br>Dim oAutoCAD As Object<br>Call <a href=\"https:\/\/www.wyrcad.com\/?p=618\">BindAutoCAD<\/a>(True)<\/p>\n\n\n\n<p>&#8216;\u6253\u5f00\u5e76\u7ed1\u5b9a\u6587\u4ef6 D:\/Test.dwg<br>Dim oDraw As Object \u2018AutoCAD \u591a\u6587\u6863\u4e4b\u4e00<br>Set oDraw = oAutoCAD.Application.Documents.Open(&#8220;D:\/Test.dwg&#8221;)<\/p>\n\n\n\n<p>&#8216;\u63d2\u5165\u8868\u683c<br>Dim oTable As Object<br>Dim dInsertPoint(2) As Double<br>dInsertPoint(0) = 12<br>dInsertPoint(1) = 12<br>dInsertPoint(2) = 0<br>Set oTable = oDraw.ModelSpace.AddTable(dInsertPoint, 6, 7, 10, 50) &#8216;\u63d2\u5165\u70b9,\u884c\u5217\u6570,\u5355\u5143\u683c\u9ad8\u5bbd<\/p>\n\n\n\n<p>&#8216;\u8c03\u6574\u5b57\u4f53<br>Call <a href=\"https:\/\/www.wyrcad.com\/?p=660\">AddTextStyle<\/a>(&#8220;Standard&#8221;)<\/p>\n\n\n\n<p>&#8216;\u586b\u5145\u8868\u683c<br>oTable.SetText 0, 0, &#8220;LOAD LIST&#8221;<\/p>\n\n\n\n<p>oTable.SetText 1, 0, &#8220;Load&#8221;<br>oTable.SetText 2, 0, &#8220;Rating(kW)&#8221;<br>oTable.SetText 3, 0, &#8220;Factor&#8221;<br>oTable.SetText 4, 0, &#8220;Voltage(kV)&#8221;<br>oTable.SetText 5, 0, &#8220;Current(A)&#8221;<\/p>\n\n\n\n<p>oTable.SetText 1, 1, &#8220;\u6f5c\u6c61\u6cf5 A&#8221;<br>oTable.SetText 2, 1, &#8220;22&#8221;<br>oTable.SetText 3, 1, &#8220;0.8&#8221;<br>oTable.SetText 4, 1, &#8220;0.38&#8221;<br>oTable.SetText 5, 1, &#8220;=B3\/(1.732\u00d7<em>B4<\/em>\u00d7B5)&#8221; &#8216;\u00d7 \u6539\u4e3a\u5408\u6cd5\u7684\u516d\u661f\u4e58\u53f7<\/p>\n\n\n\n<p>oTable.SetText 1, 2, &#8220;\u5faa\u73af\u6cf5&#8221;<br>oTable.SetText 2, 2, &#8220;37&#8221;<br>oTable.SetText 3, 2, &#8220;0.8&#8221;<br>oTable.SetText 4, 2, &#8220;0.38&#8221;<br>oTable.SetText 5, 2, &#8220;=C3\/(1.732\u00d7<em>C4<\/em>\u00d7C5)&#8221; &#8216;\u00d7 \u6539\u4e3a\u5408\u6cd5\u7684\u516d\u661f\u4e58\u53f7<\/p>\n\n\n\n<p>oTable.SetText 1, 3, &#8220;\u5916\u8f93\u6cf5&#8221;<br>oTable.SetText 2, 3, &#8220;45&#8221;<br>oTable.SetText 3, 3, &#8220;0.8&#8221;<br>oTable.SetText 4, 3, &#8220;0.38&#8221;<br>oTable.SetText 5, 3, &#8220;=D3\/(1.732\u00d7<em>D4<\/em>\u00d7D5)&#8221; &#8216;\u00d7 \u6539\u4e3a\u5408\u6cd5\u7684\u516d\u661f\u4e58\u53f7<\/p>\n\n\n\n<p>oTable.SetText 1, 4, &#8220;\u7ba1\u9053\u6cf5&#8221;<br>oTable.SetText 2, 4, &#8220;18.5&#8221;<br>oTable.SetText 3, 4, &#8220;0.8&#8221;<br>oTable.SetText 4, 4, &#8220;0.38&#8221;<br>oTable.SetText 5, 4, &#8220;=E3\/(1.732\u00d7<em>E4<\/em>\u00d7E5)&#8221; &#8216;\u00d7 \u6539\u4e3a\u5408\u6cd5\u7684\u516d\u661f\u4e58\u53f7<\/p>\n\n\n\n<p>oTable.SetText 1, 5, &#8220;\u6f5c\u6c61\u6cf5 B&#8221;<br>oTable.SetText 2, 5, &#8220;22&#8221;<br>oTable.SetText 3, 5, &#8220;0.8&#8221;<br>oTable.SetText 4, 5, &#8220;0.38&#8221;<br>oTable.SetText 5, 5, &#8220;=F3\/(1.732\u00d7<em>F4<\/em>\u00d7F5)&#8221; &#8216;\u00d7 \u6539\u4e3a\u5408\u6cd5\u7684\u516d\u661f\u4e58\u53f7<\/p>\n\n\n\n<p>oTable.SetText 1, 6, &#8220;\u7167\u660e\u7bb1&#8221;<br>oTable.SetText 2, 6, &#8220;20&#8221;<br>oTable.SetText 3, 6, &#8220;0.8&#8221;<br>oTable.SetText 4, 6, &#8220;0.38&#8221;<br>oTable.SetText 5, 6, &#8220;=G3\/(1.732\u00d7<em>G4<\/em>\u00d7G5)&#8221; &#8216;\u00d7 \u6539\u4e3a\u5408\u6cd5\u7684\u516d\u661f\u4e58\u53f7<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"252\" src=\"https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/07\/Table.jpg\" alt=\"\" class=\"wp-image-1007\" srcset=\"https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/07\/Table.jpg 957w, https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/07\/Table-300x79.jpg 300w, https:\/\/www.wyrcad.com\/wp-content\/uploads\/2024\/07\/Table-768x202.jpg 768w\" sizes=\"auto, (max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>&#8216;\u83b7\u53d6\u7b2c4\u884c\u7b2c5\u5217\u7684\u6587\u5b57<br>Debug.Print oTable.GetText(3, 4) &#8216;\u5355\u5143\u683c\u5e8f\u53f7\u57fa\u4e8e 0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u2018\u7ed1\u5b9a AutoCADDim I As Integer, J As IntegerDim oAutoCAD A &hellip; <a href=\"https:\/\/www.wyrcad.com\/?p=1002\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cAutoCAD \u7684\u8868(Table)\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[24,17],"class_list":["post-1002","post","type-post","status-publish","format-standard","hentry","category-bianchengyuandi","tag-vb","tag-biancheng"],"_links":{"self":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1002"}],"version-history":[{"count":10,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1002\/revisions"}],"predecessor-version":[{"id":1086,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/1002\/revisions\/1086"}],"wp:attachment":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}