IdeaStatica RCS - Project meta data

Is there a way to set meta data like:

@dataclass
class ProjectSettings:
name: str = “Project”
number: str = “0”
description: str = “”
author: str = “”
date: datetime.date = datetime.date.today()
design_life: YEARS = 50

I can’t find it in the documentation

Hi Johan,

As far as I know there is no functionality for this in the SDK, if you could explain a little further why this would be valuable to you we could turn this post into a feature request and see whether other users also would like to see this!

A workaround I’ve used for this in the past is just reading the xml file after it’s produced and replacing the lines with these specific attributes. Something like:

new_input_xml = BytesIO()

    for line in input_xml.getvalue().splitlines():
        if b'DesignWorkingLife' in line:
            new_input_xml.write(bytes(
                f' <DesignWorkingLife>{design_working_life}</DesignWorkingLife>\n', 'utf-8'))
            break

Hi Daniel,

Thanks for sharing your solution.
I will write a method to add these additional information. However as it is a generic item, the best location would be in the binding itself.

The reason is that we use Idea a lot in different applications. Users always check everything and keep on requesting updating this meta data even though it doesn’t really affect the calculation. I thought this would be a simple thing to add, however it wasn’t part of the binding :wink:

Yes I can’t imagine it is very complex but as you already seem to realize yourself, the priority on this feature may not be as high as we might like. But I’ll make this a feature request nonetheless! Thanks for the input!

Hi @Johan_Tuls

This is currently being developed in the SDK.

Regarding Daniels workaround, please always keep in mind that at some point these XML attributes may be added by the SDK, which means that any customized XML may clash with an SDK update. To account for this I would advise to first scan the XML for a certain attribute and only add it if not present.

1 Like

This is available in SDK v14.6.0! SDK v14.6.0 released 🎉

@khameeteman I was wondering about the new features.

Is it only available for the Model? We are using mainly the OpenModel, I could write a new adapter, but I was wondering what is the difference between the two models and which one should we use?
It could be that Model has more specific, I just remembered that when we started, model had some limitations, I haven’t checked it since.

The OpenModel:


Has no name argument.

The same counts for ProjectData and Extremes
image

image

Do you think it is possible to add them to the OpenModel also or do you suggest to use the Model instead? Which would mean a new adapter for Model instead of the OpenModel.

Hi Johan,

The difference is that the Model is easier to use than the OpenModel. The OpenModel follows the IDEA API more closely, but this is not always very intuitive in our eyes. For example creating an extreme using the OpenModel means:

  • model.create_check_member1d
  • model.add_member_data_ec2 (reference to member)
  • model.add_check_section (reference to member and cross-section)
  • section.create_extreme

Whereas this is much more simple using the Model:

  • model.create_beam (reference to cross-section)
  • beam.create_extreme

However the additional features should be present for both the Model and OpenModel! Maybe your IDE is still using a reference to an old SDK?

image

Indeed… my bad. The venv wasn’t activated. My mistakes, it seems to be present indeed.

ProjectData seems to be working fine, naming of the DesignMember doesn’t really work:

<CheckMember>
    <CheckMember xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CheckMember1D">
      <Id>1</Id>
      <Name>name</Name>
    </CheckMember>

    <CheckMember xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CheckMember1D">
      <Id>2</Id>
      <Name>name</Name>
    </CheckMember>

    <CheckMember xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CheckMember1D">
      <Id>3</Id>
      <Name>name</Name>
    </CheckMember>

    <CheckMember xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CheckMember1D">
      <Id>4</Id>
      <Name>name</Name>
    </CheckMember>

    <CheckMember xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CheckMember1D">
      <Id>5</Id>
      <Name>name</Name>
    </CheckMember>


</CheckMember>

It gets added to the xml, however it isn’t visible in Idea

We are using V22, maybe that is the reason?

I just checked and it only works in v23 indeed…