CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 01-15-2009, 09:27 PM   #1
JHN
maxscript/c# lover
 
JHN's Avatar
Johan Boekhoven
Technical Artist
nmtrix.com
Netherlands
 
Join Date: Apr 2002
Posts: 1,714
Some handy function | macroscript

Hi all,
Finally made a function to retreive all registered macroscript in an usable array, thought I'd share it. Maybe someone has use for it.

Code:
fn getMacroScripts = ( /* <DOC> Description here. Arguments: no arguments Return: <array> Returns a big array of arrays with macro meta data */ -- Setup the in and output local macroStream = stringStream "" local macroArray = #() macros.list to:macroStream seek macroStream 0 while not eof macroStream do ( -- Read a line local macroLine = readline macroStream -- Get the macro number as array local macroItem = #(substring macroLine 1 5) -- Get the rest of the line local macroRest = substring macroLine 6 -1 -- Make an array of it, filter it by qoutes local macroSplit = filterString macroRest "\"" -- Loop over the splitted array and clear the whitespace entries local macroClean = for macro in macroSplit where macro != " " collect macro -- Join the number and the rest of the items join macroItem macroClean -- Append to the final macroArray append macroArray macroItem ) -- return macro array macroArray ) -- Use it for macroscript management, menu building etc getMacroScripts()


-Johan
__________________
Online: LinkedIn | blog | nmtrix.com
Code: mxs+.net | c# | mb-python | php | html+js | mysql | python
 
Old 01-15-2009, 09:48 PM   #2
martroyx
Frequenter
Martin Dufour
Quebec, Canada
 
Join Date: Feb 2006
Posts: 202
Thank ! this may be useful
 
Old 01-15-2009, 09:48 PM   #3
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 09:50 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.