Programmatically change object name

Hi,

I’m pretty sure I saw this somewhere, but I cannot find it again.

Is there a way to change an object name programmatically?

IOW, I have a TDSO called blert and I’d like to change its name to blert001 so that I can reference it by name with something like:

local blertName

blertName = "blert001"
objectname blertName
<do something with object>
selectnoobjects

(Yeah, I have a bunch of TDSO objects on a form named blert because I duplicated an object a few times. :slight_smile: )

Sidebar question: is it possible to create a TDSO programmatically (in “classic” panorama … I think I saw that it’s possible with Pano X)

Thanks!

– Mark

You can create objects with the newformobject statement. You can specify all of its properties. To get an idea of what the properties can look like, use the Blueprint icon and show the blueprint for an object when you are in Graphics Mode. You can tweak a blueprint and use that to create a procedure to create a new object. You don’t need to use the entire list of properties, just use the ones that you want to control; the others will be set by default.
You can use the changeobject statement to rename objects. If you have five objects named blertName, this code will rename > them blert001, blert002, etc.

fileglobal fgobjectnumber
fgobjectnumber=0

loop
fgobjectnumber=fgobjectnumber+1
changeobject “blertName”,“name”,“blert”+pattern(fgobjectnumber,“###”)
until 5

Since you are asking about Panorama 6, the answer is no. You can’t do either of those.

Both can be done in Panorama X.

Dave: thanks. That’s what I figured. :slight_smile: