Referencing FemDesign.Core from GitHub

how to use the development branch

  1. Navitgate to GitHub - strusoft/femdesign-api: FEM-Design API

  2. Click on Code and Open with GitHub Desktop

  3. Open the .sln file with Visual Studio

  4. you can now choose a different branch(master is always the latest. The development branch follow the number of the milestone. The current one is 23.9.0)

  5. You can then reference this repository in your program so that you can get the WIP features :slight_smile:

Theoretically, the same procedure can be done with a FORK.
https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo

If you manage to work in this way, you will be able to also create pull request and we would consider merging them in our repository :slight_smile:

I am currently using master.
I can change to 23.9.0 dev but then I need to remake .csproj

Can I add something to my local FemDesign.Core?
Example if I want to try adding a method overload to ConcreteMaterialProperties that changes mass.

In FemDesign.Materials.Material.cs

           public static Material ConcreteMaterialProperties(Material material, double mass)
    {
        if (material.Concrete != null)
        {
            // deep clone. downstreams objs will have contain changes made in this method, upstream objs will not.
            Material newMaterial = material.DeepClone();

            // downstream and uppstream objs will NOT share guid.
            newMaterial.EntityCreated();

            // set parameters
            newMaterial.Concrete.SetMaterialParameters(mass);
            newMaterial.EntityModified();

            // return
            return newMaterial;
        }
        else
        {
            throw new System.ArgumentException("Material must be concrete!");
        }
    }

In FemDesign.Materials.Concrete.cs

internal void SetMaterialParameters(double mass)
{
this.Mass = mass;
}

As the FemDesign.Core is locked I can’t add my code and test if it works?
Would be nice before a pull request :slight_smile:

ehi @KPN

Have a look at the following blog post. I try to explain how to develop/collaborate on a project :slight_smile:
I hope is clear. If not, let me know and I will modify it with some additional comments.

I read the post and I think it gives a good overview of a lot of the questions I have had :slight_smile:
Maybe one point could be to recommend commit (save) before switching branch?
I have manage to lose some work not doing that :sweat_smile:
My understanding is that stash dosent includes untracked files that ex. new files are.

In reality, Stash is not deleting. They should still be in the branch where you stash them. Moving back to the branch, should make them reapper.

i.e. from A you move to B and you stash the changes (they will remain in A). If you then move from B to A, you should be able to unstash the changes.

I hope you can find your work again :slight_smile:

1 Like