Coder Social home page Coder Social logo

dlubal-software / dlubal_csharp_client Goto Github PK

View Code? Open in Web Editor NEW
9.0 9.0 10.0 104.58 MB

C# library and client (or high-level functions) for RFEM 6 and RSTAB 9 using Web Services, SOAP and WSDL

License: MIT License

C# 99.99% PowerShell 0.01% Batchfile 0.01%

dlubal_csharp_client's People

Contributors

belyakov-igor avatar jarabroz avatar michaelvantelgen-arcadis avatar ondramichal avatar rebecca-coding21 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

dlubal_csharp_client's Issues

FEATURE: Get all objects from one type at once

Is your feature request related to a problem? Please describe.

Whenever I want to perform an operation on an object type, e.g. all members, I would have to perform a query "model.get_member(int no)" for all members between 1-1000000. The problem is that the runtime with O(n) increases significantly by the number of members. For a few hundred members this might not be a problem. With a few thousand, including error handling for unoccupied numbers, it takes too long for me.

Describe the solution you'd like

I would like to have a method "members[] GetAllMembers" like it was available in RS8.

Additional context
I add a pdf with my testcases and a dist with my sourcecode

gist: https://gist.github.com/talSas/b7be4239d427b0f13ccdbcc63645cf43
GetAllMemberTime.pdf

BUG: get_all_object_numbers optional argument required

Describe the bug
public int[] get_all_object_numbers(Dlubal.WS.Rfem6.Model.object_types type, int parent_no)
parent_no is a required parameter in this client, although the SOAP API has marked this argument as optional:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rfem="http://www.dlubal.com/rfem.xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <rfem:get_all_object_numbers>
         <type>?</type>
         <!--Optional:-->
         <parent_no>?</parent_no>
      </rfem:get_all_object_numbers>
   </soapenv:Body>
</soapenv:Envelope>

Expected behavior
there should be a second method without the argument parent_no

public int[] get_all_object_numbers(Dlubal.WS.Rfem6.Model.object_types type)
public int[] get_all_object_numbers(Dlubal.WS.Rfem6.Model.object_types type, int parent_no)

RFEMWebServiceLibrary not loading in NET7 / NET8

Hi all,

It looks like RFEMWebServiceLibrary is not loading well in .NET 7 / .NET 8 libraries:

image

The message reads:

Package 'Dlubal.RFEMWebServiceLibrary 6.4.13' was restored using '.NETFramework,Version=v4.6.1, .NETFramework,Version=v4.6.2, .NETFramework,Version=v4.7, .NETFramework,Version=v4.7.1, .NETFramework,Version=v4.7.2, .NETFramework,Version=v4.8, .NETFramework,Version=v4.8.1' instead of the project target framework 'net8.0'. This package may not be fully compatible with your project.

I was also unable to get the RFEMWebServiceLibrary to compile in .NET 8 to resolve this issue. See this PR.

Can anyone provide assistance?

Thank you!

BUG: Missing Hyperlink in Documentation on Github

Describe the bug
The reference to the examples on the Github page leads to an error 404 - Page not found

To Reproduce
Steps to reproduce the behavior:

  1. Go to '' https://github.com/Dlubal-Software/Dlubal_CSharp_Client'
  2. Scroll down to 'Getting started - Steps for Visual Studio - Last Point'
  3. Click on 'examples(Hyperlink)'
  4. See error

Expected behavior
See examples about the use of the new api
Screenshots
grafik
Desktop (please complete the following information):

  • OS: e.g. WIN 10 2H20
  • Version of RFEM6
  • Version of tool / library [e.g. 22]

Additional context
This error happens on every examples hyperlink on the publish repo to C_Sharp_Client

BUG: export_result_tables_to_xml() E_MODEL_MEMBERS_INTERNAL_FORCES is missing member number

Describe the bug
Please have a look at the generated XML below. From my point of view it is impossible to find out which member these internal forces belong to.

            <E_MODEL_MEMBERS_INTERNAL_FORCES>
                <item>
                    <node_number>1</node_number>
                    <location>0</location>
                    <internal_force_n>0</internal_force_n>
                    <internal_force_vy>0</internal_force_vy>
                    <internal_force_vz>11065</internal_force_vz>
                    <internal_force_mt>0</internal_force_mt>
                    <internal_force_my>-34660</internal_force_my>
                    <internal_force_mz>0</internal_force_mz>
                    <specification>Balken | 2 - HEA 300 | L : 8.000 m</specification>
                </item>
                <item>
                    <location>0.40000000596046448</location>
                    <internal_force_n>0</internal_force_n>
                    <internal_force_vy>0</internal_force_vy>
                    <internal_force_vz>10711.8</internal_force_vz>
                    <internal_force_mt>0</internal_force_mt>
                    <internal_force_my>-30304.8</internal_force_my>
                    <internal_force_mz>0</internal_force_mz>
                    <specification>Balken | 2 - HEA 300 | L : 8.000 m</specification>
                </item>

Expected behavior
the member number should be added as additional information inside each <item> tag

BUG: Get an error message when connecting to an existing RStab model for the first time

Describe the bug
API access fails when accessing an existing model for the first time. Provable Reproducible

To Reproduce
Steps to reproduce the behavior:

  1. Open a RStab9 Modell
  2. Try an api access as seen in my source code ( sourcecode.png)
  3. Execute Code
  4. See error

Expected behavior
Actually, I expect that the access will not fail first, especially since it works without problems when executing the code repeatedly.

Screenshots
If applicable, add screenshots to help explain your problem.
ConnectionError
SourceCode
**Desktop (please complete the follow

ing information):**

  • OS: e.g. WIN 10 PRO Version 10.0.19043 Build 19043
  • RSTAB 9.01.0008
  • Version 1?

Additional context
Add any other context about the problem here
Rstab9CoreDump.zip
.

FEATURE: some API requests are missing in the client

Problem
This client does not contain all requests that are already available using SOAP
As an example getting model settings and options is possible using /get_model_settings_and_options

Describe the solution you'd like
As the code suggests you are using a automated tool to build this library. Please add the missing requests to your build system.

Describe alternatives you've considered
Forking the repo and adding these information by hand is cumbersome and error prone.

FEATURE: ApplicationClient.get_model_list more than only the name

Is your feature request related to a problem? Please describe.
Task: Try to get a list of all currently opened models in RFEM6 and work with them.
get_model_list returns a list of model names, but you cannot query models by name

Describe the solution you'd like
get_model_list returns only a list of names of all models that are currently opened.
please also add the index in the response

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap-enc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
   <soap:Body>
      <n1:get_model_listResponse xmlns:n1="http://www.dlubal.com/rfem.xsd">
         <value>
            <name>mymodel</name>

            <index>1</index> <=== add this line

         </value>
      </n1:get_model_listResponse>
   </soap:Body>
</soap:Envelope>

So you can access the model in the next step using get_model()

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rfem="http://www.dlubal.com/rfem.xsd">
   <soapenv:Header/>
   <soapenv:Body>
      <rfem:get_model>
         <index>1</index>
      </rfem:get_model>
   </soapenv:Body>
</soapenv:Envelope>

Other idea, maybe even better one
Also include the modelurl (http://127.0.0.1:8082/) in the response so you can directly access the model without first using get_model()

Describe alternatives you've considered
A dirty hack would be to count the number of opened models and then run a brute force search with increasing index:
Try get_model(0), get_model(1) and so on until you find all opened models.

How to request result data

hey,
I have now already tried a few things but somehow I do not get the results of result combinations or load case combinations or loadcase.

Could you ggfs give me some help?
the autocompletion to "Result" or something like that was not helpful until now.

greetings

BUG:Crashes when trying to create an imperfection_case over API

Describe the bug
Rstab9 Crashes when trying to create an imperfection_case with the type imperfection_case_type.IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP, using the Web APi
To Reproduce
Steps to reproduce the behavior:
Create Imperfaction_case over API:

Code:
public void TestImperfectionCreation()
{
imperfection_case imperfection_Case = new imperfection_case();
imperfection_Case.no = 9864;
imperfection_Case.reference_nodeSpecified = true;
imperfection_Case.type = imperfection_case_type.IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP;
imperfection_Case.typeSpecified = true;
rstab9ModelClient.set_imperfection_case(imperfection_Case);
//without type IMPERFECTION_TYPE_IMPERFECTION_CASES_GROUP rs dont crash
}
Expected behavior
create a groupe of imperfections

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • WIN 10
  • RS9.01.0011.167
  • 1.0.9

Additional context

I'm not sure if this is your responsibility, if not I would be grateful for a forwarding, screenshots and .dmps I have attached, as well as the rs9 model

Add any other context about the problem here.

Screenshots:
error1
error2
errorFinish
Work

.dmp and modell:
imperfectionError.zip

Performance question

Greetings y’all!

I was searching for a way to create objects in RSTAB remotely in C#, and it didn’t take long to find Dlubal API. After tinkering for a while with the basic example that I found, I managed to make it work – but it seemed rather slow… so I removed everything I could and ended up with a simplified method that creates one material, a series of nodes, and then adds members (that use those nodes). It works faster, but still it’s something like 10 nodes per second.
Now I’m thinking, maybe my idea was a bit silly? I thought I can add loads of objects in something close to real time. Perhaps that’s not the way this API should be used?

Here is my code, aka the stripped-down API example, with the addition of a Beam class, that has a list of points:

public static void RSTABilize(List<Beam> beams)
        {
            #region Application Settings
            try
            {
                application_information ApplicationInfo;
                try
                {
                    application = new ApplicationClient(Binding, Address);
                }
                catch
                {
                    if (application != null)
                    {
                        if (application.State != CommunicationState.Faulted)
                        {
                            application.Close();
                        }
                        else
                        {
                            application.Abort();
                        }

                        application = null;
                    }
                }
                finally
                {
                    ApplicationInfo = application.get_information();                    
                }
                #endregion
                
                string modelName = @"C:\RSTAB\temp\template.rs9"; // template

                string modelUrl = application.open_model(modelName);                
                model = model ?? new ModelClient(Binding, new EndpointAddress(modelUrl));               

                materialConcrete = materialConcrete ?? new material
                {
                    no = 1,
                    name = "C20/25 | EN 1992-1-1:2004/A1:2014"
                };

               List<section> sections = new List<section>();
                List<node> nodes = new List<node>();
                List<member> members = new List<member>();

                section sectionRectangle = new section
                {
                    no = sect++,
                    material = materialConcrete.no,
                    materialSpecified = true,
                    type = section_type.TYPE_PARAMETRIC_MASSIVE_I,
                    typeSpecified = true,
                    parametrization_type = section_parametrization_type.PARAMETRIC_MASSIVE_I__MASSIVE_RECTANGLE__R_M1,
                    parametrization_typeSpecified = true,
                    name = "R_M1 0.3/0.3", // width/height as in RFEM
                };
                               
                foreach (Beam beam in beams)
                {
                    try
                    {
                        node n1 = new node()
                        {
                            no = nod++,
                            coordinates = new vector_3d()
                            {
                                x = beam.Points[0].X,
                                y = beam.Points[0].Y,
                                z = beam.Points[0].Z
                            },
                            coordinate_system_type = node_coordinate_system_type.COORDINATE_SYSTEM_CARTESIAN,
                            coordinate_system_typeSpecified = true,
                            comment = "concrete part"
                        };

                        node n2 = new node()
                        {
                            no = nod++,
                            coordinates = new vector_3d()
                            {
                                x = beam.Points[1].X,
                                y = beam.Points[1].Y,
                                z = beam.Points[1].Z
                            },
                            coordinate_system_type = node_coordinate_system_type.COORDINATE_SYSTEM_CARTESIAN,
                            coordinate_system_typeSpecified = true,
                            comment = "concrete part"
                        };

                        //memb = 1;
                        // create member
                        member member = new member()
                        {
                            no = memb++,

                            node_start = n1.no,
                            node_startSpecified = true,
                            node_end = n2.no,
                            node_endSpecified = true,

                            section_start = sectionRectangle.no,
                            section_startSpecified = true,
                            section_end = sectionRectangle.no,
                            section_endSpecified = true,
                            comment = "concrete beam"
                        };

                        sections.Add(sectionRectangle);
                        nodes.Add(n1);
                        nodes.Add(n2);

                        members.Add(member);
                    }
                    catch { }
                }
                try
                {
                    try
                    {                        
                        
                        model.begin_modification("Geometry");
                        mod = true;
                        model.set_material(materialConcrete);
                        model.set_section(sectionRectangle);
                        

                        foreach (section sect in sections)
                            model.set_section(sect);

                        foreach (node node in nodes)
                            model.set_node(node);

                        foreach (member mem in members)
                            model.set_member(mem);
                    }
                    catch
                    {
                        model.cancel_modification();                        
                        throw;
                    }
                    model.finish_modification();                    
                }
               catch { }
                model.close_connection();
            }
            catch { }
        }

FEATURE: Close 'Application is locked' dialog using code command

Is your feature request related to a problem? Please describe.
Following [/issues/11], I think we need a command to close the 'Application is locked' dialog.

The reason the dialog is closing in the Cantilever example, is because the console application is exited (the command prompt itself doesn't need to be closed).

When you create a Form or a library for another application, the 'script' isn't closed, resulting in the dialog remaining opened. If you then close the Form or alternatively an application containing the library, the dialog disappears.

If no action is taken, the dialog remains opened exactly 90 seconds after the script is run. This is not influenced by any of the BasicHttpBinding setting possibilities.

Describe the solution you'd like
A method in RfemSoapWsCoreClient that closes the dialog, so you don't have to wait 90 seconds for the dialog to timeout.

Describe alternatives you've considered
Saving, closing and reopening the RFEM model but it seams a bad (slow) workaround.

Additional context
image

BUG: RfemModelClient finish_modification() doesn't respond

Describe the bug
Using RfemModelClient I cannot finish modification of the model using finish_modification(). This does not seam to respond to the command and the dialog in RFEM doesn't disappear.
image
When doing the finish_modification() twice I get an error message in my IDE and the dialog does disappear.
image
The error did not occur before pulling the latest commit. Did anything change? I haven't tested RSTAB - I don't have that application

To Reproduce
Steps to reproduce the behavior:

  1. Do any modification in the model
  2. Finish the modification using finish_modification() with the RfemModelClient

Expected behavior
Expected the model's modification to finish and the pop-up message to disappear.

Desktop (please complete the following information):

  • OS: WIN 10 21H1
  • Version of RFEM6.01.0003
  • Version of library: latest

Documentation of available methods and valid arguments

On the developer documentation page C#-documentation is still missing, but the Python docs can give a good idea on usage in C#.
In any case it is very hard to to see what are valid method arguments when these are type string.
Example:
RfemModelClient.begin_modification("Geometry");
RfemModelClient.begin_modification("Load");
RfemModelClient.begin_modification("Set Loads");
These are know because they are in the provided "Cantilever" example, but I suspect there are other valid arguments.

Is there a way to see a list of valid arguments for methods exposed in the RFEMWebServiceLibrary?

FEATURE: Get user selection

Is your feature request related to a problem? Please describe.
In RFEM5 RF-COM it was possible to let the user pick lines, members, nodes, ... and get a list of all selected objects.

Describe the solution you'd like
Implementing the same behaviour could lead to time out issues in the request, so it may be better to just query the model for the current selection. This could be done by having a method similiar to get_all_object_numbers that just returns the object numbers for all currently selected objects: get_all_selected_object_numbers

Describe alternatives you've considered
No idea for a workaround.

FEATURE: A simplification of the creation of load_combination_items

Is your feature request related to a problem? Please describe.
A simplification of the creation of load_combination_items, because it is annoying to mark all the specified fields as true, if the fields are marked as false the items are not accepted by rstab9.

Describe the solution you'd like
A constructor that sets every "...Specified field to true for me.

Describe alternatives you've considered
Currently, for each "..Specified" I call the field and toggle t
grafik
he value to true

Additional context
Without setting the fields, the combination_item will not be accepted by Rstab and the last_combination will remain empty

BUG: model.close and applicaton.close dont work

Describe the bug
When calling the close method nothing happens
To Reproduce
Steps to reproduce the behavior:

  1. Create API Connection to a RSTAB Model
  2. Call model.close or application.close
  3. see error or in this case nothing
    Expected behavior
    I ex

Screenshots
i expect the model to close when i call model.close and the application to close when i call application.close

Desktop (please complete the following information):

OS: e.g. WIN 10 PRO Version 10.0.19043 Build 19043
RSTAB 9.01.0008

Additional context
Add any other context about the problem here.

Contributing to the source code

Hi @jarabroz,

I have a suggestion to multi target different frameworks but I cannot seem to push my commit to the repository. I get an error message:

Failed to push the branch to the remote repository. See the Output window for more details.
Pushing michaelvantelgen-Arcadis_Multi_Framework_Targetting
Failed to push the branch to the remote repository. See the Output window for more details.
Error encountered while pushing branch to the remote repository: Git failed with a fatal error.
Git failed with a fatal error.
unable to access 'https://github.com/Dlubal-Software/Dlubal_CSharp_Client/': The requested URL returned error: 403

Any ideas on how to solve this?

FEATURE: Access the modal mode shapes by mesh node 6 as per RFEM5 API

Is your feature request related to a problem? Please describe.
We have developed a few tools which took advantage of the dynamic output from RFEM 5 to evaluate floor vibration (also available in open source here :https://github.com/knippershelbig/StructuralDesignKit_Holz)

Since RFEM 6, we cannot use it anymore.

Currently, the dynamic output are given on grid points from the surface or on intermediate result points for the members.
This is not particularly efficient nor precise to link the information back to the FE Nodes.
Masses are already available for the mesh points.

image
image

image

In RFEM 5, also accessible through the RFEM 5 COM Interface
image

Describe the solution you'd like
Ideally, having access to the modal mode shape (normalized displacement and rotation) by FE node as per RFEM 5 API would be great.
With the RFEM 5 API -> dynamicResults.GetNVCModeShapesOnFEPoint()

Describe alternatives you've considered
We are considering creating a another approach which requires creating new result objects based on the grid points and super imposing them - or looking for the closest FE node. However, this will inevitably lead to performance issue.

Additional context
Thank you very much for your help or other hints how to get access to this data!

Kind regards,
Guillaume

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.