BIM Link Example Define Import Session - idea-statica/ideastatica-public GitHub Wiki

Rstab Define Import Session

The ImportSession.cs file defines the ImportSession class which implements the IImportSession Interface.

Looking at the ImportSession class

  • It holds the Rstab model interface, which is the model related to the specific import session.
  • It also holds the Country Code which is set by the user. This is required when creating materials in IOM.
using Dlubal.RSTAB8;
using IdeaRS.OpenModel;
using IdeaStatiCa.Plugin;

namespace IdeaRstabPlugin
{
	internal class ImportSession : IImportSession
	{
		public CountryCode CountryCode { get; private set; }

		public bool IsGCSOrientedUpwards { get; private set; }

		public RequestedItemsType RequestedItemsType { get; private set; }

		private readonly IModel _model;

		public ImportSession(IModel model)
		{
			_model = model;
		}

		public void Setup(CountryCode countryCode, RequestedItemsType requestedItems)
		{
			CountryCode = countryCode;
			//IsLCSOrientedUpwards = _model.GetLocalZAxisOrientation() == OrientationType.Upward;
			IsGCSOrientedUpwards = _model.GetGlobalZAxisOrientation() == OrientationType.Upward;
			RequestedItemsType = requestedItems;
		}
	}
}