Saturday, November 21, 2009
Home   |   Search   |   About AUGI   |   My AUGI   |   Join Now

Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP
 Welcome, Guest. 

Login

Join Now FAQ Members List Calendar Search Today's Posts Mark Forums Read

AutoLISP AutoLISP or Visual LISP, learn both here!

Reply
 
Thread Tools Display Modes
Old 2004-06-22, 11:11 AM   #1
rajat126
Member
 
Join Date: 2003-12
Posts: 7
rajat126 is starting their journey
Exclamation Invisible document

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

Thanks

Rajat
Kolkata
India
rajat126 is offline   Reply With Quote
Old 2004-06-22, 04:30 PM   #2
Ed Jobe
Administrator
 
Ed Jobe's Avatar
 
Join Date: 2000-11
Location: Turlock, CA
Posts: 3,411
Ed Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining starEd Jobe is a shining star
Default

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
__________________
──Ed ──
Ed Jobe is offline   Reply With Quote
Old 2004-06-22, 05:09 PM   #3
whdjr
I could stop if I wanted to
 
Join Date: 2003-05
Posts: 335
whdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of lightwhdjr is a beam of light
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)
)
__________________
Good Blockin'

Will DeLoach
AutoCad / ADT 2006
whdjr is offline   Reply With Quote
Reply


Go Back   AUGI Forums > AUGI Technical (English) > Programming > AutoLISP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

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


All times are GMT +1. The time now is 03:54 PM.