An old thread I just stumbled on whilst searching for something.
Here are a couple of simple ways.
vanilla autolisp will cover this with a simple command line method >
(setq #Obj1(entsel "\nSelect Object:"))
(command "_updatefield" #Obj1 "")
or combine if you need the variable later
(command "_updatefield" (setq #Obj1(entsel "\nSelect Object:")) "")
or just the one line
(command "_updatefield" (entsel "\nSelect Object:") "")
in VisualLisp you can use vla-sendcommand >
Although this needs to be written as you'd type it directly at the command prompt and a bit harder to ensure you get the string with a variable.
(vl-load-com) ; load visual lisp programming base.
(setq #thisdwg (vla-get-activedocument (vlax-get-acad-object)))
(vla-SendCommand #thisdwg "_updatefield ")<make sure there is one space after the _updatefield as it will emulate the enter key to accept the command at the command line
You can expand on the send command to ask a more appropriate question etc. but will need to pass a variable to the command line >
(setq #Obj1(entsel "\nSelect object to update fields:"))
(setq #thisdwg (vla-get-activedocument (vlax-get-acad-object)))
(vla-SendCommand #thisdwg "_.updatefield !#Obj1 ") < two spaces after !@Obj1 for the line to be run through at the command prompt.
the " ! " prior to the variable is the way you'd see the variable value if typing at the command prompt eg: !variablename