I would like to ask if somebody knows a fast method to create surfaces by loading node id's from excel. At the moment I use the code below, it works fine but its very slow when I want to put in a lot of surfaces. For nodes I use the putAllArray method which is really fast, I wonder if something similar is possible for surfaces?
Thanks for any help.
Sub Create_surfaces() 'Connect to femap Dim femap As Object Set femap = GetObject(, "femap.model") Dim Node As Object Set Node = femap.feNode 'Dim general items Dim iRow As Integer Dim start_row As Integer Dim start_column As Integer Dim Num_surf As Integer Dim Number_Input As Integer Dim RC1 Dim p1 As Double Dim p2 As Double Dim p3 As Double Dim p4 As Double 'Set the start of the input start_row = Range("S2") start_column = Range("S3") Num_surf = Range("S4") Number_Input = Range("S5") 'Dim coordinate sets for each node Dim c1, c2, c3, c4 ReDim c1(1 To 3) As Double ReDim c2(1 To 3) As Double ReDim c3(1 To 3) As Double ReDim c4(1 To 3) As Double 'Fill the coordinate sets for each node For j = 0 To Number_Input iRow = start_row For i = 1 To Num_surf p1 = Cells(iRow, start_column + 3) p2 = Cells(iRow, start_column + 4) p3 = Cells(iRow, start_column + 5) p4 = Cells(iRow, start_column + 6) Node.Get (p1) c1(1) = Node.x c1(2) = Node.y c1(3) = Node.z Node.Get (p2) c2(1) = Node.x c2(2) = Node.y c2(3) = Node.z Node.Get (p3) c3(1) = Node.x c3(2) = Node.y c3(3) = Node.z Node.Get (p4) c4(1) = Node.x c4(2) = Node.y c4(3) = Node.z 'Put the surface in femap RC1 = femap.feSurfaceCorners(True, c1, c2, c3, c4) iRow = iRow + 1 Next i start_column = start_column + 12 Next j femap.feViewRegenerate (0) End Sub
Solved! Go to Solution.
There really isn't a better way for now... however we have already added an feSurfaceCornersMultiple( ) API method that will be included in the next release. It will allow you to specify any number of surfaces to create in one API call.