
- 這是一些ObjectDBX的限制, ObjectDBX不能存取變數,但有外掛acadX.arx則可以存取變數(但現在要收費了)
- Here are some assumptions that I am going on from my results. If anyone can
- verify them I would appreciate it.
- 1.) You cannot use setvariable or getvariable functions in the ObjectDBX
- file, but commands that depend on these settings adopt the values from the
- activedocument in the AutoCAD application.
- 2.) There is no ActiveUCS, active layer, or active color in the ObjectDBX
- file, and these again are adopted from the activedocument in the AutoCAD
- application.
- 3.) You can only use the saveas method to save the ObjectDBX file.
- 4.) You cannot use the close method to close an ObjectDBX file.
- 5.) When you use the open method on the dbx_document (opened ObjectDBX file)
- it closes the existing file without saving it. ObjectDBX essentially works
- with only 1 drawing file at a time.
- ;;;Do not use (vla-* methods with ObjectDBX.AxDbDocument, or any
- ;;;other object in the AxDb15Lib type library.
- ;;;(vla-*) methods are intended for use with AutoCAD's Automation
- ;;;model, not with ObjectDBX (the two are very similar, leading
- ;;;one to believe that (vla-*) methods apply to both, but in fact,
- ;;;they don't, and in cases where (vla-*) methods do work, it is
- ;;;purely by accident).
- ;;有外掛acadX.arx可用下列程序-------未更新---我也沒有acadX.arx 8-(
- (defun REGISTEROBJECTDBX (/ DBXSERVER) ;by Tony Tanzillo
- (cond
- ((vl-registry-read
- "HKEY_CLASSES_ROOT\\ObjectDBX.AxDbDocument\\CLSID"
- )
- )
- ((not (setq DBXSERVER (findfile "AxDb15.dll")))
- (alert "Error: Can't locate ObjectDBX Library (AxDb15.dll)")
- )
- (t
- (startapp "regsvr32.exe" (strcat "/s "" DBXSERVER """))
- (or
- (vl-registry-read
- "HKEY_CLASSES_ROOT\\ObjectDBX.AxDbDocument\\CLSID"
- )
- (alert
- "Error: Failed to register ObjectDBX ActiveX services."
- )
- )
- )
- )
- )
- (arxload "acadx.arx" NIL)
- (defun DBXGETVAR (DWGNAME VARNAME / XDB DBXDOC *ACAD* RES)
- (if (not (REGISTEROBJECTDBX))
- (exit)
- )
- (vl-load-com)
- (setq *ACAD* (vlax-get-acad-object))
- (setq DBXDOC
- (vla-getinterfaceobject
- *ACAD*
- "ObjectDBX.AxDbDocument"
- )
- )
- (setq XDB
- (vla-getinterfaceobject
- *ACAD*
- "AcadX.Database"
- )
- )
- (vlax-invoke-method DBXDOC 'open DWGNAME)
- (vlax-put-property
- XDB
- 'DATABASE
- (vlax-get-property DBXDOC 'DATABASE)
- )
- (setq RES
- (vlax-invoke-method
- XDB
- 'GETVARIABLE
- VARNAME
- )
- )
- (vlax-release-object XDB)
- (vlax-release-object DBXDOC)
- RES
- )
- (DBXGETVAR "11.DWG""CECOLOR")
|