Cancel
Showing results for 
Search instead for 
Did you mean: 

Listing Model Information

Pioneer
Pioneer

Hi !

 

Below I have written a code to list model information that I would like to specifically see, but the problem that I am experiencing is that :

 

1) It does not list the correct element ID, when I run the program it lists all element IDs as -1.

2) On line 20 it gives me the following error message :  Expecting ' ) '

 

Could someone please assist me in correcting my code.

 

Thanks in advance Smiley Happy

 

The HTML Clipboard

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

    Dim n As femap.Node
    Set n = App.feNode

    Dim e As femap.Elem
    Set e = App.feElem

    Dim p As femap.Prop
    Set p = App.feProp

    App.feAppMessageStartListing()
    App.feAppMessage (FCM_NORMAL, "List Model Info" )

    While n.Next()

        App.feAppMessage( FCM_NORMAL, " Element : " +  Str$(e.ID))
        App.feAppMessage( FCM_NORMAL, " Property : " + Str$(p.ID) + _ " " + p.title + " " + p.type)
        App.feAppMessage( FCM_NORMAL, " Node : " + Str$(n.ID) + " xyz =  " + _
            Str$(n.x) + " " + Str$(n.y) + " " + Str$(n.z))

    Wend

    App.feAppMessageEndListing()

End Sub

2 REPLIES

Re: Listing Model Information

Legend
Legend

Hello RedP,

 

 

In your code you iterate only through nodes using n.Next() function. To iterate through elements and properties you need to use 2 separate cycles:

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

    Dim n As femap.Node
    Set n = App.feNode

    Dim e As femap.Elem
    Set e = App.feElem

    Dim p As femap.Prop
    Set p = App.feProp

    App.feAppMessageStartListing()
    App.feAppMessage (FCM_NORMAL, "List Model Info" )

    While n.Next()
        App.feAppMessage( FCM_NORMAL, " Node : " + Str$(n.ID) + " xyz =  " + _
            Str$(n.x) + " " + Str$(n.y) + " " + Str$(n.z))
    Wend

    While e.Next()
        App.feAppMessage( FCM_NORMAL, " Element : " +  Str$(e.ID))
    Wend

    While p.Next()
        App.feAppMessage( FCM_NORMAL, " Property : " + Str$(p.ID) + " " + p.title + " ") ' + p.type
    Wend

    App.feAppMessageEndListing()

End Sub

In property there is an issue with displaying p.type - basic can't convert enumeration to the text I suppose. 

I commented type for the moment, so the tool can be run.

But it is required to solve somehow the issue with type.

 

Yarko

Re: Listing Model Information

Pioneer
Pioneer

Thank you @yarko this seemed to work.