Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Switch Post Data to Next Output Set using API 1

Status
Not open for further replies.

MaartenE

Structural
Oct 18, 2013
3
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
 
Replies continue below

Recommended for you

Hello,

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!
 
Thanks for your reply. I have created the following script using your code:
Code:
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 Sub

The model i have been testing it on has 2 outputsets.
The code however makes FEMAP (11.0) crash.
 
Huh cool, youi found a great way to make FEMAP crash!
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor