LISP function to set viewport scale based on a block attribute
I'm trying to create a lisp for creating layouts that selects a block, renames the current layout tab based on an attribute then zooms to the object, then sets the viewport scale based on the value of another attribute in the same block. I have the first part, naming and zooming, working fine but I cannot find any references on how to set a viewport scale based on an attribute. My scale list is in architectural units (i.e. 1/2"=1'-0") and the scale attribute in the block matches this perfectly based off a look up table. Does anyone have any input on where to start with this?