Description Adds a detector entity to the document.
Syntax deNode = DECreate( deType, params, deName, deDesc )
Parameters deNode (Long) Returned node number for the newly created detector entity.
deType As String String specifying the type of detector entity to be created. Valid entries are: "Cylinder" "Sphere" "Plane" "Cone"
params As String String specifying the parameters of the detector entity being created. An empty string creates the detector entity with default values. The parameter string has the form "Param1=Val1 : Param2=Val2", where individual parameter and value pairs are separated by the use of colons.
deName As String Name of the detector entity being created.
deDesc As String Description of the detector entity being created.
Example The following example demonstrates the use of several detector entity specific commands to create a new detector entity, assign parameters (using two methods), retrieve parameter information, and perform and display the analysis results.
Sub Main
Dim deType As String, params As String, deName As String, deDesc As String, paramNames() As String Dim deNode As Long
ClearOutputWindow
'Set basic information create a detector entity deType = "Cylinder" deName = "Cylinder Detector Entity" deDesc = "Scripted cylinder D.E." params = "" deNode = DECreate( deType, params, deName, deDesc )
'Set parameters for the D.E. using individual parameter name and value DESetParam deNode, "ADim", 31 DESetParam deNode, "BDim", 51 DESetParam deNode, "Calculation", "Irradiance" DESetParam deNode, "CalcTiming", "On Request" DESetParam deNode, "Sidedness", "Negative Side" DESetParam deNode, "AbsorbRay", "True"
'Set parameters for the D.E.using a single parameter string 'draw parameters params = params & "Draw=True : " params = params & "DrawMode=Fill : " params = params & "DrawColor=(127,255,0) : " 'cylinder specific parameters params = params & "PrimaryAxis=X : " params = params & "SecondaryAxis=Y : " params = params & "AIsPrimary=True : " params = params & "Radius=5 : " params = params & "LMin=-2 : " params = params & "LMax=4 : " params = params & "AziMin=-90 : " params = params & "AziMax=45" DESetParams deNode, params
'Update the document with the changes Update
'Retrieve and print information from the detector entity Print DEGetType( deNode ) & " type detector entity created at node number " & deNode Dim jj As Long DEGetParamNames deNode, paramNames Print "Parameter List" Print Chr(9) & "Name" & Chr(9) & "Value" For jj = 0 To UBound( paramNames, 1 ) Print Chr(9) & paramNames( jj ) & Chr(9) & DEGetParam( deNode, paramNames( jj ) ) Next jj
'Trace source, perform detector entity analysis and put the result in the visualization view Dim arnNode As Long, cnt As Long, success As Boolean Print "Performing raytrace..." ARNDeleteAllNodes EnableTextPrinting False DeleteRays() TraceCreate() EnableTextPrinting True Print "Performing D.E. analysis..." cnt = DEPerformAnalysis( deNode ) Print cnt & " rays included in D.E. analysis..." arnNode = DEGetMostRecentARNNum( deNode ) Print "D.E. analysis results in ARN node " & arnNode Print "Displaying D.E. results in visualization view..." success = ARNDisplayInVisualizationView( arnNode, "" ) Print "All done..."
End Sub
Parameter List
See Also
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||