Cancel
Showing results for 
Search instead for 
Did you mean: 

How to call the "Model->Element" dialog box from API?

Pioneer
Pioneer

Hi,

 

I've been trying to find a method for getting the same dialog box as when creating a new element with "Model->Element (Ctrl+E)". Does anyone know how to call this method from the API?

 

BR

Kris

 

 

5 REPLIES

Re: How to call the "Model->Element" dialog box from API?

Valued Contributor
Valued Contributor

Hi Krisu,

 

If you are trying to mesh something, you can use the meshing methods listed in Chapter 3.9 of the Femap API reference manual.

 

The code should be as follows:

App.method(parameters)

 

As an example, please find the following code which meshes a certain geometry:

 

The HTML Clipboard

Dim surface_mesh_set As femap.Set
Set surface_mesh_set = App.feSet

rc = surface_mesh_set.AddRule(1,FGD_SURFACE_ID)

App.feMeshSizeSurface(surface_mesh_set.ID,True,0.5,0,0,0,0,0,False,0,0,False )
App.feMeshSurface2(surface_mesh_set.ID, lug_prop.ID,FTO_QUAD4,False,False)

Re: How to call the "Model->Element" dialog box from API?

Siemens Phenom Siemens Phenom
Siemens Phenom

As with any command, you can always use the program file equivalent to call it using feFileProgramRun( )...

 

The HTML Clipboard

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    App.feFileProgramRun( False, True, False, "{ME}" )

End Sub

Re: How to call the "Model->Element" dialog box from API?

Pioneer
Pioneer

Thanks! feFileProgramRun helped!

However how do you know this syntax {ME}? I cannot find it in the API manual.

 

BR,

Kris

Re: How to call the "Model->Element" dialog box from API?

Legend
Legend

Hi Krisu,

 

you can use the App.feRunCommand( CommandID, True) method. To finding CommandID, see my earlier reply:

 

https://community.plm.automation.siemens.com/t5/Femap-Discussion-Forum/How-to-call-create-CSys-Stand...

 

In this command, when you use the parameter True (second parameter), this method only returns when the command is finished. If False, it returns immediately.

Similarly you can lanch all command from the Femap menus.

 

Best regards

 

Peter Kaderasz

Re: How to call the "Model->Element" dialog box from API?

Siemens Phenom Siemens Phenom
Siemens Phenom

For any command in a program file you simply enclose the underlined/keyboard shortcut letters for that command in braces { }.   If you hold down the Alt key, you will see the shortcut letters underlined in the menu. As an alternative, you can simply open the Program File Pane, turn on Record and choose the command. The text will be recorded to the pane and you can simply copy it into your API. This is a good method if you want to create an API that has a longer program snippet than just choosing one command.