ms-structural / ms-structural/femdesign-api

Implementation of partial struxml workflow (.str as base model)

Open
#609 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority:next type:feature waiting:fd-developer
Dominant language
C#
Stars
51
Forks
29
PR merge metrics
No merged PRs in 30d

Description

For full scope read here: https://strusoft.fogbugz.com/f/cases/97299/StruXML-Update-str-file-with-partial-struxml-data

This case will fix #520

Problem

Allow user to:

  • Read .str and open model in GH/C#
  • Create, update or delete (CRUD) one or several elements
  • Merge/paste partial .struxml with new information only into .str using .fdscript

Example

I have a model.str that looks like this:

image

If I want to update this model.str using the API toolbox today I need to first serialise it to .struxml then modify this .struxml representation and then save it as .str. In this process some settings are lost as described in the fogbugz case. Moreover, I need to always work with a full set of data.

I would like to change this workflow by utilising the Update model (simple merge by time). This would allow us to modify an existing .str without saving to .struxml and then rebuilding the .str from this .struxml. Instead we could modify an existing .str by sending updates for the elements we are interested in changing only.

Move support

Using this partial .struxml containing the support only with new properties

<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) StruSoft 2012-2021, http://www.strusoft.com -->
<database struxml_version="01.00.000" source_software="FEM-Design 21.00.005" start_time="1970-01-01T00:00:00.000" end_time="2022-11-24T11:44:55.000" guid="5b07e756-ff36-4018-a174-7e9de0161d31" convertid="00000000-0000-0000-0000-000000000000" standard="EC" country="GB" xmlns="urn:strusoft">
	<entities>
		<supports>
			<point_support guid="50a32777-9cc6-40c7-863d-d020cf8515ba" last_change="2022-11-24T11:44:56.000" action="modified" name="S.1">
				<group>
					<local_x x="1" y="0" z="0"></local_x>
					<local_y x="0" y="1" z="0"></local_y>
					<rigidity>
						<motions x_neg="10000000000" x_pos="10000000000" y_neg="10000000000" y_pos="10000000000" z_neg="10000000000" z_pos="10000000000"></motions>
						<rotations x_neg="10000000000" x_pos="10000000000" y_neg="10000000000" y_pos="10000000000" z_neg="10000000000" z_pos="10000000000"></rotations>
					</rigidity>
				</group>
				<position x="0" y="0" z="0"></position>
			</point_support>
		</supports>
	</entities>
	<end></end>
</database>

I can move it:

move-support

Change section cross-section

Using this partial .struxml containing the bar with new complex section reference

<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) StruSoft 2012-2021, http://www.strusoft.com -->
<database struxml_version="01.00.000" source_software="FEM-Design 21.00.005" start_time="1970-01-01T00:00:00.000" end_time="2022-11-24T11:44:55.000" guid="5b07e756-ff36-4018-a174-7e9de0161d31" convertid="00000000-0000-0000-0000-000000000000" standard="EC" country="GB" xmlns="urn:strusoft">
	<entities>
		<bar name="B.1" type="beam" guid="9865fb2e-b2ea-432a-8ae9-0c462605f8f2" last_change="2022-11-24T11:44:49.000" action="modified">
			<bar_part guid="449bf38d-53a5-4a70-a939-4d7eb1f7be1d" last_change="2022-11-24T11:44:48.000" action="added" name="B.1.1" complex_material="fc81b7bd-5582-498b-92f5-f32c18ff26fd" complex_section="91d54008-d35a-4085-b252-16b56c95801e" ecc_calc="true">
				<curve type="line">
					<point x="0.760026835905627" y="0.812411907371354" z="0"></point>
					<point x="0.760026835905628" y="5.92634768091011" z="0"></point>
				</curve>
				<local-y x="-1" y="0" z="0"></local-y>
				<connectivity m_x="true" m_y="true" m_z="true" r_x="true" r_y="true" r_z="true"></connectivity>
				<connectivity m_x="true" m_y="true" m_z="true" r_x="true" r_y="true" r_z="true"></connectivity>
				<eccentricity use_default_physical_alignment="true">
					<analytical x="0" y="0" z="0"></analytical>
					<analytical x="0" y="0" z="0"></analytical>
					<physical x="0" y="0" z="-0.15"></physical>
					<physical x="0" y="0" z="-0.15"></physical>
				</eccentricity>
				<end></end>
			</bar_part>
			<end></end>
		</bar>
	</entities>
	<sections>
		<section guid="9441614c-9706-43d5-b2c5-c3122bf224e6" last_change="1970-01-01T00:00:00.000" action="added" name="Concrete sections, Rectangle, 550x1200" type="custom" fd-mat="3" fd_name_code="Concrete sections" fd_name_type="Rectangle" fd_name_size="550x1200">
			<region_group>
				<region>
					<contour>
						<edge type="line">
							<point x="-0.275" y="-0.6" z="0"></point>
							<point x="0.275" y="-0.6" z="0"></point>
							<normal x="0" y="1" z="0"></normal>
						</edge>
						<edge type="line">
							<point x="0.275" y="-0.6" z="0"></point>
							<point x="0.275" y="0.6" z="0"></point>
							<normal x="-1" y="0" z="0"></normal>
						</edge>
						<edge type="line">
							<point x="0.275" y="0.6" z="0"></point>
							<point x="-0.275" y="0.6" z="0"></point>
							<normal x="0" y="-1" z="0"></normal>
						</edge>
						<edge type="line">
							<point x="-0.275" y="0.6" z="0"></point>
							<point x="-0.275" y="-0.6" z="0"></point>
							<normal x="1" y="0" z="0"></normal>
						</edge>
					</contour>
				</region>
			</region_group>
			<end></end>
		</section>
		<complex_section guid="91d54008-d35a-4085-b252-16b56c95801e" last_change="1970-01-01T00:00:00.000" action="added">
			<section pos="0" guid="9441614c-9706-43d5-b2c5-c3122bf224e6">
				<ecc x="0" y="0" z="0"></ecc>
				<end></end>
			</section>
			<section pos="1" guid="9441614c-9706-43d5-b2c5-c3122bf224e6">
				<ecc x="0" y="0" z="0"></ecc>
				<end></end>
			</section>
		</complex_section>
	</sections>
	<end></end>
</database>

I can update the section:

change-bar-section

Add hole to slab

Using this partial .struxml containing the slab with a modified region:

<?xml version="1.0" encoding="UTF-8"?>
<!-- (c) StruSoft 2012-2021, http://www.strusoft.com -->
<database struxml_version="01.00.000" source_software="FEM-Design 21.00.005" start_time="1970-01-01T00:00:00.000" end_time="2022-11-24T11:44:55.000" guid="5b07e756-ff36-4018-a174-7e9de0161d31" convertid="00000000-0000-0000-0000-000000000000" standard="EC" country="GB" xmlns="urn:strusoft">
	<entities>
		<slab name="P.1" guid="2f170ba0-52a3-4285-a327-6ca3c710fef8" last_change="2022-11-24T11:44:54.000" action="modified" type="plate">
			<slab_part guid="d5f80b3e-bf5e-46a1-9931-76de0ec912af" last_change="2022-11-24T11:44:54.000" action="modified" name="P.1.1" complex_material="fc81b7bd-5582-498b-92f5-f32c18ff26fd" alignment="center" align_offset="0" ortho_alfa="0" ortho_ratio="1">
				<contour>
					<edge type="line">
						<point x="2.31565063617495" y="1.32120960642289" z="0"></point>
						<point x="4.68477668418115" y="1.32120960642289" z="0"></point>
						<normal x="0" y="1" z="0"></normal>
					</edge>
					<edge type="line">
						<point x="4.68477668418115" y="1.32120960642289" z="0"></point>
						<point x="4.68477668418115" y="4.63573850347652" z="0"></point>
						<normal x="-1" y="0" z="0"></normal>
					</edge>
					<edge type="line">
						<point x="4.68477668418115" y="4.63573850347652" z="0"></point>
						<point x="2.31565063617495" y="4.63573850347652" z="0"></point>
						<normal x="0" y="-1" z="0"></normal>
					</edge>
					<edge type="line">
						<point x="2.31565063617495" y="4.63573850347652" z="0"></point>
						<point x="2.31565063617495" y="1.32120960642289" z="0"></point>
						<normal x="1" y="0" z="0"></normal>
					</edge>
				</contour>
				<contour>
					<edge radius="0.302797080247025" type="circle">
						<point x="2.8143234384846" y="3.655119365896" z="0"></point>
						<normal x="0" y="0" z="-1"></normal>
					</edge>
				</contour>
				<thickness x="2.31565063617495" y="1.32120960642289" z="0" val="0.2"></thickness>
				<local_pos x="3.50021366017805" y="2.97847405494971" z="0"></local_pos>
				<local_x x="1" y="0" z="0"></local_x>
				<local_y x="0" y="1" z="0"></local_y>
				<end></end>
			</slab_part>
			<end></end>
		</slab>
	</entities>
	<materials>
		<material guid="fc81b7bd-5582-498b-92f5-f32c18ff26fd" last_change="2013-07-19T11:42:36.000" action="added" standard="EC" country="GB" name="C25/30">
			<concrete mass="2.54842" E_0="31000000" E_1="31000000" E_2="31000000" nu_0="0.2" nu_1="0.2" nu_2="0.2" alfa_0="0.00001" alfa_1="0.00001" alfa_2="0.00001" G_0="12916666.6666667" G_1="12916666.6666667" G_2="12916666.6666667" Fck="25" Fctk="1.8" Fctm="2.6" Ecm="31000" gammaC_0="1.5" gammaC_1="1.2" gammaCE="1.2" gammaS_0="1.15" gammaS_1="1" alfaCc="0.85" alfaCt="1" Fcd_0="14.1666666666667" Fcd_1="17.7083333333333" Fctd_0="1.2" Fctd_1="1.5" Ecd_0="20666.6666666667" Ecd_1="25833.3333333333" Epsc2="0.002" Epscu2="0.0035" Epsc3="0.00175" Epscu3="0.0035" environment="0" creep="0" shrinkage="0" nu="0.2" alfa="0.00001"></concrete>
		</material>
	</materials>
	<end></end>
</database>

I can add a hole:

change-slab-contour

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked FogBugz case for the full scope, then review issue #520 and the existing .str/.struxml API workflow. The work is done when users can read a .str, perform CRUD operations, and merge partial .struxml updates through .fdscript without losing existing settings, including the support, section, and slab examples.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend-api-design
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.