# This template will export boundary nodes in their # drawing order (triangular and qudrilateral mesh) # # It can be used to export the nodes in the order they # are drawn for a drawing program or a plotter. # # The list of nodes is exported in 3 different formats # Use the one you want or customize a format to a new one # # IMPORTANT NOTE: This template is only designed for # externla boundary nodes. It may fail to export # the nodes of internal boundaries. If you customize # it for internal boundaries let us know and we will post it # # This template make use of the ArrayPIE dll. You must have # such two Array PIEs placed in your ArgusPIE directory # One should be named MyArray1.dll and the MyArray2.dll # The ArrayPIE can be downloaded from our ftp site at: # ftp://ftp.argusone.com/pub/ArgusPIEs/PC_PIEs/ArrayPIE/ArrayPIE.dll # Define Variable: i [Integer] Define Variable: j [Integer] Define Variable: starti [Integer] Define Variable: last2 [Integer] Define Variable: NumberOfBoundarySegments [Integer] Define Variable: NumberOfBoundaryNodes [Integer] Define Variable: ok [Integer] Define Variable: ok2 [Integer] Define Variable: Test [Integer] Set Variable: NumberOfBoundarySegments:= 0 # # Set Variable: j:= 0 Set Variable: i:= -1 Set Variable: last2:= 0 Set Variable: NumberOfBoundaryNodes:= 2*CountNodes(NodeOnBoundary()) # # This part of the template will calculate the element edges that # are on the boundary of the mesh (triangular mesh) and load them # into an array (MyArray1.DLL) # # This part is a modification of the OutEdge template # Redirect output to: $BaseName$ # # Initialize two arrays - for each one an Array PIE dll # file must be in the Argus PIE directory # Set Variable: ok:= 1 Set Variable: Test:= MyArray1Init(NumberOfBoundaryNodes) If: IsNAN(Test) Alert: "The PIE MyArray1.DLL could not be found! Please make sure such a PIE is in the ArgusPIE directory!" Set Variable: ok:= 0 End if # Set Variable: ok:= 1 Set Variable: Test:= MyArray2Init(NumberOfBoundaryNodes) If: IsNAN(Test) Alert: "The PIE MyArray2.DLL could not be found! Please make sure such a PIE is in the ArgusPIE directory!" Set Variable: ok:= 0 End if # If: ok # Fill both arrays with zeros Loop for: Variable i from: 0 to: NumberOfBoundaryNodes-1 step: 1 Evaluate expression: MyArray1Set(i,0) Evaluate expression: MyArray2Set(i,0) End loop # # This part will loop through the elements and assign the array members the node numbers # Set i to -1 because the arrays start at 0 Set Variable: i:= -1 # Loop for: Elements # Output all boundary edges # the output (for each edge )will be: # elem node1 node2 # where: # elem is the number of the element # node1 is the first node of the edge (counterclockwise when looking from elem) # node2 is the second node of the edge If: NthNeighbourNum(1) = 0 Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(1)) Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(2)) End if If: NthNeighbourNum(2) = 0 Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(2)) Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(3)) End if If: NthNeighbourNum(3) = 0 Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(3)) Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(4)) End if If: NthNodeNum(1)!=NthNodeNum(4) If: NthNeighbourNum(4) = 0 Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(4)) Set Variable: i:= i+1 Evaluate expression: MyArray1Set(i,NthNodeNum(1)) End if End if End loop # # Loop through the array containing the boundary nodes and copy them to a new array # in the order they appear in the mesh, each node followed by the node it is # connected to Evaluate expression: MyArray2Set(0,MyArray1Get(0)) Evaluate expression: MyArray2Set(1,MyArray1Get(1)) Evaluate expression: MyArray1Set(0,0) Evaluate expression: MyArray1Set(1,0) Set Variable: CurrentBoundaryNodesCount:= 2 Set Variable: starti:= 2 Set Variable: ok2:= 1 Loop for: Variable last2 from: 1 to: NumberOfBoundaryNodes-1 step: 1 If: ok2 Set Variable: ok:= 1 Loop for: Variable i from: starti to: NumberOfBoundaryNodes-1 step: 1 If: (MyArray2Get(last2)= MyArray1Get(i)) & ok Evaluate expression: MyArray2Set((last2+1),MyArray1Get(i+1)) Evaluate expression: MyArray1Set(i,0) Evaluate expression: MyArray1Set(i+1,0) Set Variable: ok:= 0 If: MyArray2Get(last2+1)=MyArray2Get(0) Set Variable: ok2:= 0 End if End if End loop End if End loop # # # Write the boundary nodes in order, one on a line, to a file # Start a new line Export expression: "Ordered Boundary Nodes" [G0] End line Loop for: Variable i from: 0 to: (NumberOfBoundaryNodes/2) step: 1 If: MyArray2Get(i)!=0 Start a new line Export expression: MyArray2Get(i) [G0] End line End if End loop # # # Write the boundary nodes in order, one on a line with its X and Y Coordinate, to a file # Start a new line End line Start a new line Export expression: "Ordered Boundary Nodes and X Y positions" [G0] End line Loop for: Variable i from: 0 to: (NumberOfBoundaryNodes/2) step: 1 If: MyArray2Get(i)!=0 Set Variable: j:= j+1 Start a new line Export expression: MyArray2Get(i); [G0] Export expression: CalcAtNodeNumber(MyArray2Get(i), X()); [G0] Export expression: CalcAtNodeNumber(MyArray2Get(i), Y()) [G0] End line End if End loop # # # Write the boundary nodes as an Argus ONE contour # Start a new line End line Start a new line Export expression: "Ordered Boundary Nodes as an Argus ONE contour" [G0] End line Start a new line Export expression: "## Name:" [G0] End line Start a new line Export expression: "## Icon:0" [G0] End line Start a new line Export expression: "# Points Count Value" [G0] End line Start a new line Export expression: j [G0] End line Start a new line Export expression: "# X pos Y pos" [G0] End line Loop for: Variable i from: 0 to: (NumberOfBoundaryNodes/2) step: 1 If: MyArray2Get(i)!=0 Start a new line Export expression: CalcAtNodeNumber(MyArray2Get(i), X()); [G0] Export expression: CalcAtNodeNumber(MyArray2Get(i), Y()) [G0] End line End if End loop # Evaluate expression: MyArray1Dispose() Evaluate expression: MyArray2Dispose() End if End file