(if (= acLibImport nil) (vlax-import-type-library :tlb-filename "C:\\Program Files\\Common Files\\Autodesk Shared\\axdb18enu.tlb" :methods-prefix "acdbm-" :properties-prefix "acdbp-" :constants-prefix "acdbc-" ) (setq acLibImport T) ) ) (setq acdbObj (vlax-create-object "ObjectDBX.AxDbDocument.18")) (acdbm-open acdbObj files\\External Drawing.dwg") (setq cntDimstyles 0) (vlax-for acObject (vla-get-Dimstyles acdbObj) (setq arTemp arDimStyles) (setq arDimStyles (vlax-make-safearray vlax-vbObject (cons 0 cntDimstyles))) (setq cntStep 0) (repeat cntDimstyles (vlax-safearray-put-element arDimStyles cntStep (vlax-safearray-get-element arTemp cntStep)) (setq cntStep (1+ cntStep)) ) (vlax-safearray-put-element arDimStyles cntDimstyles acObject) (setq cntDimstyles (1+ cntDimstyles)) ) (setq acadObj (vlax-get-acad-object)) (setq docObj (vla-get-activedocument acadObj)) (setq dbObj (vla-get-database docObj)) (setq dimstylesColl (vla-get-dimstyles dbObj)) (vla-copyobjects acdbObj arDimStyles dimstylesColl) (vlax-release-object acdbObj) (princ) )
(if (= acLibImport nil) (vlax-import-type-library :tlb-filename "C:\\Program Files\\Common Files\\Autodesk Shared\\axdb18enu.tlb" :methods-prefix "acdbm-" :properties-prefix "acdbp-" :constants-prefix "acdbc-" ) (setq acLibImport T) ) ) (setq acdbObj (vlax-create-object "ObjectDBX.AxDbDocument.18")) (acdbm-open acdbObj files\\External Drawing.dwg") (setq cntDimstyles 0) (vlax-for acObject (vla-get-Dimstyles acdbObj) (setq arTemp arDimStyles) (setq arDimStyles (vlax-make-safearray vlax-vbObject (cons 0 cntDimstyles))) (setq cntStep 0) (repeat cntDimstyles (vlax-safearray-put-element arDimStyles cntStep (vlax-safearray-get-element arTemp cntStep)) (setq cntStep (1+ cntStep)) ) (vlax-safearray-put-element arDimStyles cntDimstyles acObject) (setq cntDimstyles (1+ cntDimstyles)) ) (setq acadObj (vlax-get-acad-object)) (setq docObj (vla-get-activedocument acadObj)) (setq dbObj (vla-get-database docObj)) (setq dimstylesColl (vla-get-dimstyles dbObj)) (vla-copyobjects acdbObj arDimStyles dimstylesColl) (vlax-release-object acdbObj) (princ) )
v3_CP4177_Ambrosius.docx