TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: cuda on May 22, 2019, 03:27:13 AM

Title: Cannot create ObjectDBX
Post by: cuda on May 22, 2019, 03:27:13 AM
Hello Guys,
I have a problem when running this code:
Code - Auto/Visual Lisp: [Select]
  1. (defun c:Example_CopyObjects()
  2.     ;; This example creates a Circle object and uses the CopyObjects
  3.     ;; method to make a copy of the new Circle.
  4.     (setq acadObj (vlax-get-acad-object))
  5.     (setq doc (vla-get-ActiveDocument acadObj))
  6.  
  7.     ;; Load the ObjectDBX library
  8.     (if (= acLibImport nil)
  9.                (progn
  10.                    (vlax-import-type-library :tlb-filename "C:\\Program Files\\Common Files\\Autodesk Shared\\axdb20enu.tlb"
  11.                                              :methods-prefix "acdbm-"
  12.                                              :properties-prefix "acdbp-"
  13.                                              :constants-prefix "acdbc-"
  14.                    )
  15.             (setq acLibImport T)
  16.         )
  17.     )
  18.  
  19.     ;; Create a reference to the ObjectDBX object
  20.     (setq acdbObj (vlax-create-object "ObjectDBX.AxDbDocument.20"))
  21. )
  22.  
This piece of code is part of an example of "CopyObjects" method from ACAD2016 help file.
My problem is that the last line returns nil which isn't supposed to be. My AutoCAD2016 runs on windows10.  I tried this code on another win7 machine with the same version ACAD and it's OK. Could anybody please help me out?
Title: Re: Cannot create ObjectDBX
Post by: roy_043 on May 22, 2019, 03:33:54 AM
Within little over 30 minutes you have posted the same problem 10 times. Please stop reposting and be a little patient!
Title: Re: Cannot create ObjectDBX
Post by: myloveflyer on May 22, 2019, 03:56:59 AM
Hey, friend, it’s best to delete your same post.
Title: Re: Cannot create ObjectDBX
Post by: kdub_nz on May 22, 2019, 05:59:11 AM


What does this return at the command line ( or in the VLIDE )

Code - Auto/Visual Lisp: [Select]
  1. (findfile "C:\\Program Files\\Common Files\\Autodesk Shared\\axdb20enu.tlb")