Results 1 to 3 of 3

Thread: Invisible document

  1. #1
    Member
    Join Date
    2003-12
    Posts
    7
    Login to Give a bone
    0

    Exclamation Invisible document

    Hi,
    Is it possible that I can open a file and access its data in invisible mode ?

    Thanks

    Rajat
    Kolkata
    India

  2. #2
    Administrator Ed Jobe's Avatar
    Join Date
    2000-11
    Location
    Turlock, CA
    Posts
    6,411
    Login to Give a bone
    0

    Default Re: Invisible document

    Using the ObjectDbx ActiveX api. Its possible to use it in lisp, but I only use it in vba. I have written a class module to make implementing it easy. Here is a link
    C:> ED WORKING....


    LinkedIn

  3. #3
    I could stop if I wanted to
    Join Date
    2003-05
    Posts
    335
    Login to Give a bone
    0

    Default Re: Invisible document

    Rajat,

    There is a way to edit files using ObjectDBX thru VisualLisp. Below is some code I wrapped around Robert Bell's LayerFilterDelete to access all the files in a selected directory. Keep in mind the files can not be open. Robert has rewritten his tool for the newer versions of ACAD here, my code works for ACAD2K.

    HTH,

    Code:
     (vl-load-com) 
     
    (defun DLLRegister (dll)
      (startapp "regsvr32.exe" (strcat "/s \"" dll "\""))
    )
     
    (defun ProgID->ClassID (ProgID)
      (vl-registry-read
    	(strcat "HKEY_CLASSES_ROOT\\" progid "\\CLSID")
      )
    )
     
    (defun DBX-Register (/ classname)
      (setq classname "ObjectDBX.AxDbDocument")
      (cond
    	((ProgID->ClassID classname))
    	((and
    	   (setq server (findfile "AxDb15.dll"))
    	   (DLLRegister server)
    	   (ProgID->ClassID classname)
    	 )
    	 (ProgID->ClassID classname)
    	)
    	((not (setq server (findfile "AxDb15.dll")))
    	 (alert
    	   "Error: Cannot locate ObjectDBX Type Library (AxDb15.dll)..."
    	 )
    	)
    	(T
    	 (DLLRegister "ObjectDBX.AxDbDocument")
    	 (or
    	   (ProgID->ClassID "ObjectDBX.AxDbDocument")
    	   (alert
      "Error: Failed to register ObjectDBX ActiveX services..."
    	   )
    	 )
    	)
      )
    )
    (defun LayerFiltersDelete (doc)
      (vl-Catch-All-Apply
    	'(lambda ()
    	   (vla-Remove
      (vla-GetExtensionDictionary
    	(vla-Get-Layers doc)
      )
      "ACAD_LAYERFILTERS"
    	   )
    	 )
      )
    )
     
    (defun w:*error* (msg)
      (princ "\nError: ")
      (princ msg)
      (princ)
      (if (not (vlax-object-released-p dbxdoc))
    	(vlax-release-object dbxdoc)
      )
      (gc)
      (princ)
    )
    
    (defun c:lfd_odbx (/ path folder files cnt dbxdoc of *error*)
      (setq path   (getfiled "Select a File" "" "dwg" (+ 4 128))
     folder (vl-filename-directory path)
     files  (vl-directory-files folder "*.dwg" 1)
     cnt	0
     w:*error* *error*
      ) 
      (if (not (DBX-Register))
    	(*error* "Could not load the ObjectDBX Interface.")
      )
      (setq dbxdoc (vla-GetInterfaceObject
       (vlax-get-acad-object)
       "ObjectDBX.AxDbDocument"
    		)
      )
      (foreach file files
    	(setq of (vl-catch-all-apply
    		'(lambda ()
    	(vlax-invoke-method dbxdoc 'open (strcat folder "\\" file))
      )
    	  )
    	)
    	(if (vl-catch-all-error-p of)
    	  (*error* (vl-catch-all-error-message of))
    	  (progn
     (LayerFiltersDelete dbxdoc)
     (vla-saveas dbxdoc (strcat folder "\\" file))
    	  )
    	)
    	(setq cnt (1+ cnt))
      )
      (vlax-release-object dbxdoc)
      (gc)
      (princ)
    )

Similar Threads

  1. Document 3D
    By jbenoit44 in forum Revit Architecture - General
    Replies: 7
    Last Post: 2010-08-31, 07:29 PM
  2. Invisible DWF
    By tiffany.amorgan in forum AutoCAD LT - General
    Replies: 1
    Last Post: 2009-06-09, 01:33 PM
  3. AIA BIM document
    By DaveP in forum Revit Architecture - General
    Replies: 0
    Last Post: 2008-10-29, 03:52 PM
  4. Invisible line shouldn't be invisible
    By WolffG in forum Revit Architecture - Wish List
    Replies: 0
    Last Post: 2003-12-19, 01:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •