Is there a way to convert a recorded macro in femap to an API code ?? I have below an API code to run in femap to create groups from color, but my code seems to be off as I am not the familiar with programming. Any suggestions or changes to the code will help as well as an API code to save what is within the graphics window to a jpeg. Please help.
Sub Main Dim App As femap.model Set App = feFemap()
Dim color_ As femap.color Set color_ = App.feColor
Dim group_ As femap.Group
Dim colorOnSurf_set As femap.Set Set colorOnSurf_set = App.feSet
While color_.Next 'go through all colors If (color_.ID <> 1) And (color_.ID <> 9999) App.feAppMessage(FCM_NORMAL, "Working on color :" & Str(color_.ID) &"=>" & " " & color_.title )
colorOnSurf_set.Clear colorOnSurf_set.AddEntitiesOnSurf( -color_.ID, FT_SURFACE) ' collect surfaces in the set
Set group_ = App.feGroup group_.title = color_.title group_.SetAdd(FT_SURFACE, colorOnSurf_set.ID) ' add surfaces from the set group_.Put(group_.NextEmptyID) End If End While Wend End Sub