Author Topic: Setting projectname system variable with ObjectDbx?  (Read 1757 times)

0 Members and 1 Guest are viewing this topic.

mkweaver

  • Bull Frog
  • Posts: 352
Setting projectname system variable with ObjectDbx?
« on: May 01, 2008, 10:06:50 AM »
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: [Select]
(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
  )

Any suggestions are appreciated.

Mike Weaver

T.Willey

  • Needs a day job
  • Posts: 5251
Re: Setting projectname system variable with ObjectDbx?
« Reply #1 on: May 01, 2008, 11:20:13 AM »
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)

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)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

mkweaver

  • Bull Frog
  • Posts: 352
Re: Setting projectname system variable with ObjectDbx?
« Reply #2 on: May 01, 2008, 04:08:37 PM »
I was afraid I couldn't do this with ObjectDbx.  Time to look for other options.

Thanks,
Mike