Switch Post Data to Next Output Set using API
Switch Post Data to Next Output Set using API
(OP)
Hi there,
I'm writing a small API macro which makes a snapshot of my currect Output view and pasts this image in word.
Using the 'Word Report Generator' as an example I have already created the part which takes a snapshot of the current view ans pasts it into ms Word.
I have been studying the api.pdf but I just don't understand on how I make femap view the Next Output Set (like clicking the 'Switch Post Data to Next Output Set' button in the 'Post' toolbar).
Hope anyone can help.
With kind regards,
Maarten
I'm writing a small API macro which makes a snapshot of my currect Output view and pasts this image in word.
Using the 'Word Report Generator' as an example I have already created the part which takes a snapshot of the current view ans pasts it into ms Word.
I have been studying the api.pdf but I just don't understand on how I make femap view the Next Output Set (like clicking the 'Switch Post Data to Next Output Set' button in the 'Post' toolbar).
Hope anyone can help.
With kind regards,
Maarten





RE: Switch Post Data to Next Output Set using API
You need the view object. Here's a way:
app.feappgetactiveview(vID) => retrieve active view ID
view.get(vID)
view.outputset = osID => the one you want
'if you need to change the outpout vector use view.contourdata or .deformdata
view.put(view.id)
you might need to regenerate with app.feviewregenerate(0 or vI)
Hope this works!
RE: Switch Post Data to Next Output Set using API
CODE --> BASIC
Sub Main Dim App As femap.model Set App = GetObject(,"femap.model") Dim viewID As Long Dim feView As femap.View Set feView = App.feView App.feAppGetActiveView( viewID ) App.feView.Get(viewID) App.feView.OutputSet = 1 App.feView.Put(viewID) App.feViewRegenerate(0) End SubThe model i have been testing it on has 2 outputsets.
The code however makes FEMAP (11.0) crash.
RE: Switch Post Data to Next Output Set using API
Avoid the the double methods (app.feview.*) and it works fine.
APav
Sub Main
Dim App As femap.model
Set App = feFemap()
Dim viewID As Long
Dim feView As femap.View
Set feView = App.feView
App.feAppGetActiveView( viewID )
feView.Get(viewID)
feView.OutputSet = 1
feView.Put(viewID)
App.feViewRegenerate(0)
End Sub
RE: Switch Post Data to Next Output Set using API