Notifications
Clear all

[Closed] Custom dialog from text file

Hey Guys,
I have a text file with x or so lines of text stored in a text file(will change by case).
Now i want to take those x lines and make a rollout with them. The lines will be the text for labels. How would i go about achieving this? Examples would be great!!!

5 Replies

This is done in Rollout Army Knife, download it and check how I did it if you like.

sorrry I guess I wasnt clear enough… I want to dynamically create the labels from the text file that will be changing by case.

Hi,

You can use Dynamic Rollout Creation (“RolloutCreator Functions” in MAXScript Reference).
This way is not easy in some cases but I think it’s a good solution for your problem.

You can try :

-- Create dynamic rollout
rolloutFileLabels = rolloutCreator "rolloutDialog" "File Labels"
rolloutFileLabels.begin()

-- Open your file

NbLines = 20 -- Get number of lines in your file

for IdxLine = 1 to NbLines do
(
	LabelName = "Label" + IdxLine as string
	LabelText = "Label " + IdxLine as string -- Get current line text in your file
	rolloutFileLabels.addControl #label LabelName LabelText
)

createDialog (rolloutFileLabels.end())

Thats perfect thanks man