Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

Simple API for View Options 1

Status
Not open for further replies.

MBD26

Aerospace
Mar 2, 2009
18
0
0
US
Does anyone have a simple API script for turning on Node IDs (only Nodes) that they'd be willing to share? Complete novice to API, and having some trouble with the syntax. That would be a huge help. Many thanks
 
Replies continue below

Recommended for you

Since you said you were new to the API, I wrote this one for you, you can edit this to test and see if node labels are already on, and if so, turn them off and make it a quick toggle. I added comments to each line to hopefully help with your FEMAP API learning -

Sub Main
' Connect to the current running FEMAP as App
Dim App As femap.model
Set App = feFemap()

' Create a new empty feView Object
Dim feView As femap.View
' Connect it to App
Set feView = App.feView

' Integer to hold the current view ID
Dim viewID As Long

' Find out what the current active view ID is
rc = App.feAppGetActiveView( viewID )

' Use the viewID and load the feView object with that
' view's settings
If feView.Get( viewID ) = femap.FE_OK Then
' Make sure nodes are being drawn, FVI_NODE is
' defined as "7" which is always nodes
feView.Draw( FVI_NODE) = True
' And turn on the labels
feView.Label( FVI_NODE) = 1
' take this API's feView object and update
' the one in the FEMAP database
rc = feView.Put( viewID )
' Force a regen so that this view gets redrawn
rc = App.feViewRegenerate( viewID )
End If

End Sub
 
That worked like a charm mrFEMAP. You are the boss.

Is there a repository of API programs you built I can get access to other than Custom Tools? That would be awesome. Please email me at stressebookllc at gmail dot com.

One of the tools I am looking for is to move a nodal load from one node to another.


Stressing Stresslessly!
 
Status
Not open for further replies.
Back
Top