Simple naming object script

Hi all,

Wonder if someone can help me out. I just want a simple script to name selected object. A small window with three buttons, CollisionBox, CollisionConvex, CollisionMesh and named exactly as indicated.

much appreciated.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
airbrush's picture

thank you :)

thank you :)

barigazy's picture

*.ms

Also here is *.ms

AttachmentSize
collisionnamer.ms 1.22 KB

bga

barigazy's picture

this is your script

(
try (destroyDialog ::CollisionRoll) catch()
rollout CollisionRoll " Collision Namer"
(
	dropdownlist ddl_names "" items:#("CollisionBox", "CollisionConvex", "CollisionMesh") pos:[5,5] width:150 height:10
	checkbox cb_use " Use Unique Name" pos:[6,30] width:190 height:16
	edittext et_objsname "" pos:[1,50] fieldwidth:150 height:17 enabled:off
	button btn_rename "Rename!" pos:[5,70] width:150 height:18
 
	on cb_use changed state do (et_objsname.enabled = state ; ddl_names.enabled = not state)
	on btn_rename pressed do
	(
		if selection.count == 0 then messageBox "Select Some Object First!" title:"Warning" beep:off else
		(
			local objName = if not cb_use.checked then ddl_names.items[ddl_names.selection] else
			(
				if et_objsname.text == "" then (messageBox "Specify name!" title:"Warning" beep:off ; undefined) else et_objsname.text
			)
			if objName != undefined do (for o in selection do o.name = uniquename objName)
		)
	)
)
createdialog CollisionRoll 160 92 10 110 style:#(#style_titlebar, #style_sysmenu, #style_toolwindow) ; ok
)

bga

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.