purge without opening dwg

purge without opening dwg

Anonymous
Not applicable
1,603 Views
3 Replies
Message 1 of 4

purge without opening dwg

Anonymous
Not applicable

 

(defun c:tt1()
    ;; This example creates a Circle object and uses the CopyObjects
    ;; method to make a copy of the new Circle.
    (setq acadObj (vlax-get-acad-object))
    (setq doc (vla-get-ActiveDocument acadObj))
    ;; Load the ObjectDBX library
    (if	(= acLibImport nil)
			(progn
				(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 (findfile "C:/test.dwg"))

		(Vlax-Invoke-Method acdbObj 'purgeall)	
		(Vlax-Invoke-Method acdbObj 'SaveAs "C:/test.dwg")
	
    ;; Close the in memory drawing
    (vlax-release-object acdbObj)
)

I think I can not purge via DBX.

 

So what can I do with DBX?Is there a list of methods that I can use via DBX?

 

0 Likes
Accepted solutions (1)
1,604 Views
3 Replies
Replies (3)
Message 2 of 4

_gile
Consultant
Consultant

Hi,

 

You can only use the ActiveX interface.



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes
Message 3 of 4

Anonymous
Not applicable

But it can not find purgeall method via DBX

0 Likes
Message 4 of 4

_gile
Consultant
Consultant
Accepted solution

No you can't use PurgeAll.

 

To get all available properies and method for acadObj, do:

 

(vlax-dump-object acadObj T)


Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

0 Likes