Thanks for the inputs. I can now create a form with default values filled in but there is still a missing component. When I try to get the fields I have to reference them and everything I have tried either gives nil for all fields or the defaults and not the user entry. Here is the code and when the dialog box dismisses it returns {nil nil nil}. How do I get to the values that the user has filled into the form boxes?
;Get the values and print them in a list
procedure(FileFormCallback(theForm)
let((
ValueList
)
ValueList = nil
for(i 0 2
ValueList = append(ValueList list(nth(i theForm->fieldList)->value))
);End for
printf("%L\n" ValueList)
);End let
);End procedure
;Create the form fields
procedure(DisplayForm()
let((
i
)
FieldList = nil
N = 3
for(i 1 3
FieldList = append(FieldList list(hiCreateStringField(
?name gensym(sprintf(nil "CL%dLayerField" i))
?prompt sprintf(nil "Computational Layer %d Name:" i)
?defValue sprintf(nil "CL%dLayer" i)
?callback "FileFormCallback(hiGetCurrentForm())"
?editable t
);End hiCreateStringField
);End list
);End append
);End for
FileForm = hiCreateAppForm(
?name 'FileForm
?formTitle "Test"
?callback "FileFormCallback(hiGetCurrentForm())"
?fields FieldList
?buttonLayout 'OKCancel
?unmapAfterCB t
);End hiCreateAppForm
);End let
hiDisplayForm(FileForm)
);End procedure