none
Class Interoperability problem RRS feed

  • Question

  • Hello,

    I try to write a simple programme for structural analysis software, that generates a geometry (beams with defined cross-section and material). 
    I'm struggling with the problem I cannot solve myself.
    Short story long:
    To generate a beam I have to first:
    1. Create a material. Class Material generates in the project specific materials.
    2. Create a cross-section, cross-section use the material's GUID. Class CrossSection generates in the project specific css.
    3. Create a beam using cross-section's GUID. Class Beam generates in the project specific beams. 

    I have e.g 10 cross-sections but 3 materials. How to construct a classes to have an access to GUID numbers based on kind of a key. Should I implement dictionary? All input data are read from excel so I want it to be automatic.
    Dictionary first came to my mind because of possible pairs  {"HallowSection200" - "MaterialGuid1"},{"HallowSection40" - "MaterialGuid2"} etc.

    Number of materials is always less than 5. Maybe I should generate always all materials and then call enum?

    I would appreciate  any technical advises!

    Regards

    Saturday, October 12, 2019 7:43 AM

All replies

  • Hi MarcinLas, 

    Thank you for posting here.

    According to your description, I find that your problem may involve a big project, so I suggest you divide your problem into many cases, then we can provide better help for specific problems.

    Besides, you can provide some related code about your question, and it will help us to analyze your problem and make a test.

    Best Regards,

    Xingyu Zhao


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 14, 2019 7:24 AM
    Moderator
  • As best as I understand a dictionary sounds good. An alternative might be to make 5 properties, such as HallowSection200GUID and HallowSection40GUID.

    Does that help?



    Sam Hobbs
    SimpleSamples.Info

    Monday, October 14, 2019 4:28 PM