{"id":933,"date":"2024-06-27T08:51:03","date_gmt":"2024-06-27T00:51:03","guid":{"rendered":"http:\/\/www.wyrcad.com\/?p=933"},"modified":"2024-06-28T13:37:34","modified_gmt":"2024-06-28T05:37:34","slug":"autocad-%e4%bb%8e-dictionarys-%e4%b8%ad%e8%af%bb%e5%8f%96%e6%95%b0%e6%8d%ae","status":"publish","type":"post","link":"https:\/\/www.wyrcad.com\/?p=933","title":{"rendered":"AutoCAD \u4ece Dictionarys \u4e2d\u8bfb\u53d6\u6570\u636e"},"content":{"rendered":"\n<p>\u2018\u7ed1\u5b9a AutoCAD<br>Dim I As Integer, J As Integer<br>Dim oAutoCAD As Object \u2018AutoCAD Application \u672c\u8eab<br>Call BindAutoCAD(True)<br>Dim oDraw As Object \u2018AutoCAD \u591a\u6587\u6863\u4e4b\u4e00<\/p>\n\n\n\n<p>\u2018\u6253\u5f00\u5e76\u7ed1\u5b9a\u6587\u4ef6 D:\/Test.dwg<br>Set oDraw = oAutoCAD.Application.Documents.Open(\u201cD:\/Test.dwg\u201d)<\/p>\n\n\n\n<p>\u2018\u5728 Dictionarys \u4e2d\u67e5\u627e \u201cNew Dic\u201d\uff0c\u5e76\u8bfb\u53d6\u201d\u5c5e\u6027\u201d App \u7684\u503c<br>Dim sTemp As String<br>sTemp = GetDicString(oDraw, \u201cNew Dic\u201d, \u201c\u5c5e\u6027\u201d)<\/p>\n\n\n\n<p>Public Function GetDicString(ByVal vDraw As Variant, ByVal sDic As String, ByVal sApp As String) As String &#8216;\u5728 Dictionarys \u4e2d\u67e5\u627e \u201cNew Dic\u201d\uff0c\u5e76\u8bfb\u53d6\u201d\u5c5e\u6027\u201d App &#8220;1000&#8221; \u4f4d\u7801\u7684\u503c<br>GetDicString = &#8220;&#8221;<br>Dim I As Integer, J As Integer<br>Dim XTypeOut As Variant<br>Dim XValueOut As Variant<br>Dim oDic As Object<br>Set oDic = vDraw.Dictionaries.Item(sDic)<br>oDic.GetXData sApp, XTypeOut, XValueOut<br>If Not IsArray(XTypeOut) Or Not IsArray(XValueOut) Then Exit Function<br>For I = LBound(XTypeOut) To UBound(XTypeOut)<br>If XTypeOut(I) = 1000 Then GetDicString = XValueOut(I)<br>Next I<br>End Function<\/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=933\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201cAutoCAD \u4ece Dictionarys \u4e2d\u8bfb\u53d6\u6570\u636e\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-933","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\/933","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=933"}],"version-history":[{"count":9,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/933\/revisions"}],"predecessor-version":[{"id":980,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=\/wp\/v2\/posts\/933\/revisions\/980"}],"wp:attachment":[{"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=933"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=933"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wyrcad.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=933"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}