ACK!!
Ok when I run this script it doesn't return the values I place into GA, GB and GC.. it just runs the command with out the values which mean effectively it does nothing but ask for information and do nothing with it. I have no idea what I've done wrong but perhaps someone can enlighten me?
'starting a new function and calling it "GeoAprox"
GeoAprox
Function GeoAprox
'if XSI decides to screw up
On Error Resume Next
'get the selected object for later use
dim selected
set selected = getvalue("selectionlist")
'checking if the Selection is valid or not
if Selected = "" then
MsgBox "Nothing selected"
exit Function
end if
'In case the user Changed the name of the Scene Root
'Find the Scene_Root object
set mySceneRoot = EnumElements("Project", TRUE)
set mySceneRoot = SIFilter(mySceneRoot, "Scene", TRUE )(0)
set mySceneRoot = EnumElements( mySceneRoot , TRUE)
set mySceneRoot = SIFilter(mySceneRoot, "SceneObject", TRUE)(0)
'in case someone as already created a custom parameter named "Geoap"
set geoap_name = AddProp ("Custom_parameter_list",mySceneRoot, , "Geoap").Value("Value")
'adding custom parameters to choose from
SIAddCustomParameter geoap_name, "Surface U", siUByte, 0.000, 1, 10,siClassifVisualization , 0, 0.000, 0.000
SIAddCustomParameter geoap_name, "Surface V", siUByte, 0.000, 1, 10,siClassifVisualization , 0, 0.000, 0.000
SIAddCustomParameter geoap_name, "Subdivision", siUByte, 0.000, 0.000, 4,siClassifVisualization , 0, 0.000, 0.000
'Creating variables for later use
dim GA
dim GB
dim GC
'Opening the CustomParameter for the user to Interact with
InspectObj mySceneRoot & "." & geoap_name,,"Geometry Aproximation",4
'setting variables "GA,GB&GC" to hold the value you set for the U&V
set GA = GetValue(geoap_name &".Surface_U")
set GB = GetValue(geoap_name &".Surface_V")
set GC = GetValue(geoap_name &".Subdivision")
'setting the u and v to those values
AddProp "GeomApprox"
SetValue (selected &".geomapprox.gapproxvwustep"), GA
SetValue (selected &".geomapprox.gapproxvwvstep"), GB
SetValue (selected &".geomapprox.gapproxmosl"), GC
'deleting the Custom Parameter
DeleteObj mySceneRoot & "." & geoap_name
end Function