×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Switch Post Data to Next Output Set using API

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

RE: Switch Post Data to Next Output Set using API

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!

RE: Switch Post Data to Next Output Set using API

(OP)
Thanks for your reply. I have created the following script using your code:

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 Sub 

The 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

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

RE: Switch Post Data to Next Output Set using API

(OP)
Thanks alot, it works like a charm!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources