The following are the miscellaneous functions that are used for a vareity of purposes in COD scripts. In most cases, the syntax can be copied/pasted directly into a file and function properly. They should be edited for your particular use. This allows you to short cut your time by not having to experiment to figure out code syntax.
Please take notice of the following notes…
(a) – Undocumented in prior Autodesk documentation
Function | Notes | Example | Return Value |
---|---|---|---|
breakpoint | (a) | breakpoint | |
debug | debug("My Alert Box") debug "My Alert Box" | n/a | |
dim | dim myvariable dim myarray as array dim myarray as array([#]) dim myobject as itemstruct | n/a | |
error | (a) | error("Custom Error Message") error "Custom Error Message" | n/a |
exec | exec("[prog]" , [flags] , "[params]" , "[work dir]") [prog] = Program to execute [flags] = exec_default, exec_wait, exec_show_normal, exec_show_max, exec_show_min [params] = Parameters passed to program [work dir] = Working directory for program exec("Notepad.exe", exec_wait+exec_show_min, , "") | ||
include | include "C:\\My Script.cod" | ||
inputbox | inputbox("Title", "Prompt", "Default") | {User entered data} | |
object | object [my file] = new file("[file]" , [mode]) object [my file] as file("[file]" , [mode]) | ||
output | (a) | output("Send Message to Console") output "Send Message to Console" | |
query | query("Chose Yes or No") | True/False | |
rem | Rem This is a Note | n/a | |
requires | requires task requires task.selection | ||
run | run "C:\\My Script.cod" | n/a |