#Request! Api for to create groups according to color and thicknesses

Pioneer
Pioneer

Hi.

 

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

3 REPLIES

Re: #Request! Api for to create groups according to color and thicknesses

Esteemed Contributor
Esteemed Contributor

This is the Solid Edge Forum.  May have beeter luck in a FEMAP forum.


Thanks,
Ken

Production: ST9 MP10
Testing: ST10 MP1

Re: #Request! Api for to create groups according to color and thicknesses

Pioneer
Pioneer
Hi. Thanks I thought it was all one forum. Smiley Happy

Re: #Request! Api for to create groups according to color and thicknesses

Esteemed Contributor
Esteemed Contributor

Nope, that's why this one is called "Solid Edge Forum" Smiley LOL

 

Try this one: https://community.plm.automation.siemens.com/t5/Femap-Discussion-Forum/bd-p/femap-forum


Thanks,
Ken

Production: ST9 MP10
Testing: ST10 MP1