Code Red > AutoLISP (Vanilla / Visual)

Setting projectname system variable with ObjectDbx?

(1/1)

mkweaver:
I am trying to push a new project name out to an entire directory branch of drawings with object dbx.  I have the following procedure, but I get an error message: ActiveX Server returned the error: unknown name: SetVariable

--- Code: ---(defun PushProjectName(doc pname / Success)
 (setq
   doc (if (null doc)
(vla-get-activedocument (vlax-get-acad-object))
doc
)
   )
  (vla-setvariable doc "projectname" pname)
  (if (= pname (vla-getvariable doc "projectname"))
    (setq success T)
    )
  success
  )
--- End code ---

Any suggestions are appreciated.

Mike Weaver

T.Willey:
Can't be done.
Here is the list of methods you can use on a drawing opened with ObjectDBX

--- Quote ---; Methods supported:
;   CopyObjects (3)
;   DxfIn (2)
;   DxfOut (3)
;   HandleToObject (1)
;   ObjectIdToObject (1)
;   Open (2)
;   Save ()
;   SaveAs (2)

--- End quote ---

See how different they are from the active document open in the editor

--- Quote ---; Methods supported:
;   Activate ()
;   AuditInfo (1)
;   Close (2)
;   CopyObjects (3)
;   EndUndoMark ()
;   Export (3)
;   GetVariable (1)
;   HandleToObject (1)
;   Import (3)
;   LoadShapeFile (1)
;   New (1)
;   ObjectIdToObject (1)
;   Open (2)
;   PurgeAll ()
;   Regen (1)
;   Save ()
;   SaveAs (3)
;   SendCommand (1)
;   SetVariable (2)
;   StartUndoMark ()
;   Wblock (2)

--- End quote ---

mkweaver:
I was afraid I couldn't do this with ObjectDbx.  Time to look for other options.

Thanks,
Mike

Navigation

[0] Message Index

Go to full version