|
Welcome, Guest.
|
||||||
| AutoLISP AutoLISP or Visual LISP, learn both here! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: 2003-12
Posts: 7
![]() |
Hi,
Is it possible that I can open a file and access its data in invisible mode ? Thanks Rajat Kolkata India |
|
|
|
|
|
#3 |
|
I could stop if I wanted to
Join Date: 2003-05
Posts: 335
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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) )
__________________
Good Blockin' Will DeLoach AutoCad / ADT 2006 |
|
|
|
![]() |
|
||||||
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Invisible Lines | cphubb | Revit Architecture - General | 5 | 2004-08-17 09:53 AM |
| Problem in working in multiple document environment | rajat126 | AutoLISP | 2 | 2004-06-22 03:10 PM |
| Filled region boundary: invisible | Henry D | Revit Architecture - General | 1 | 2004-01-11 06:24 PM |
| Invisible line shouldn't be invisible | WolffG | Revit Architecture "Original" Wish List (Archived) | 0 | 2003-12-19 02:23 PM |