I have the following code that will select a viewport and take the custom scale field into another text, attribute text.
I have a scale block that has 3 attributes.
FULL
HALF
DOUBLE
I did not know what would be the best way to have this routine from one click of the viewport fill out the other 2 attributes.
(defun c:test (/ vpObj fldObj vpID util fldtxt)
(vl-load-com)
(setq vpObj (vlax-ename->vla-object
(car (nentsel "\nSelect the viewport: "))
)
fldObj (vlax-ename->vla-object (car (nentsel "\nSelect the Field: ")))
vpID (vla-get-objectid vpObj)
)
(if (> (vl-string-search "x64" (getvar "platform")) 0)
(progn
(setq util (vla-get-Utility
(vla-get-activedocument (vlax-get-acad-object))
)
vpID (vlax-invoke-method
util
"GetObjectIdString"
vpObj
:vlax-False
)
)
)
(setq vpID (vl-princ-to-string (vla-get-Objectid vpObj)))
)
(setq fldtxt (strcat "%<\\AcObjProp Object(%<\\_ObjId "
vpID
">%).CustomScale \\f \"%lu2%ct1%ps\%qf2816\">%"
)
)
(vla-put-textstring fldObj fldtxt)
(vla-update fldObj)
(vla-regen (vla-get-activedocument (vlax-get-acad-object))
1
)
(princ))
thanks for any direction!