.. comment all inline tags to start with _how_scpt_243_is_ .. index:: Scripts; How to - Core Model IS .. index:: Scripts; How to - Core Model FDIS .. index:: Scripts; How to - Core Model DIS .. index:: Scripts; How to - Core Model CD .. _how_scpt_core_is_top: STEPlib SysML: How To use the IS Core Model Scripts ########################################################## .. include:: /pages/common/pageunderconstruction.txt :start-line: 3 This page explains how to use the Scripts of the STEP architecture to generate the documentation for the IS for Core Model. Other pages (in progress) explain the process for other APs which include content for more of the architecture. The image below shows the models in the STEP Extended Architecture that are used by, and generated for, the International Standard documentation. .. figure:: /images/howto/ht_scpt_is_architecture_Core.png :scale: 100% STEP Extended Architecture showing usage in this set of scripts .. contents:: Contents: :local: :depth: 1 :backlinks: top ======================== Prerequists ======================== .. warning:: work in progress DO A SPELL CHECKING BEFORE EXPORTING. Needs: * java (saxon and tagsoup jar provided) * Python json.tool (for pretty print of JSON schema) * Ruby (for generation of Canonical XMI) and additional Gems: Ruby 2.5.3 (using an internet connection without proxy/firewall):: gem install mini_portile2 gem install systemu gem install macaddr gem install uuid gem install rubyzip gem install nokogiri Commands are assuming executingting in cmd window on PC. The add to path if not already there. .. figure:: /images/howto/ht_scpt_ruby_env.png :scale: 100% Add ruby to path environment variable .. rst-class:: expand ========================== Process explained ========================== .. attention:: The Core model reuses the scripts for generating the 4xxx documentation using the core model in place of the domain model. It does not use the scripts for 2xx documents, nor the scripts for implementation models. .. include:: /pages/howto/howtoScriptOverview.txt ======================== Export images from |MD| ======================== .. important:: The image output settings must be set to 100% File/Save as image/Image format/Options .. figure:: /images/howto/ht_scpt_imagesize.png :scale: 100% set Export diagram size to 100% Assuming a |MD| license is available: In |MD| use the STEPlib\utils\MagicDraw\exportDiagramsMacro.js to generate the diagram images. see :ref:`gs_md_macros` for how to load and use macros. Open the Core_model, select the Core_model package and run the macro. This should create the png in the STEPlib/Core_model folder. .. figure:: /images/howto/ht_scpt_exphtml.png :scale: 100% Export diagrams to png with macro If there is no |MD| license, then the macros are not available. In this case the process is to export the diagrams using the inbuilt exporter, then generate and run a batch file which will rename the resultant images. #. Open the Core_model then select **File > Save As Image** #. Select all the diagrams and save as png to the model folder without dvlp, overwriting existing files: .. figure:: /images/howto/ht_scpt_no_macro.png :scale: 100% Export diagrams to png using out-of-the-box |MD| #. when executing the scripts, after the **CanonicalGenerateIDsXML** labeled **rename images if not using the macro**. .. todo:: find out how to use macros with "reader" |MD|. Have checked with normal |MD| in evaluation model (i.e. no SysML license) and works OK. .. _how_scpt_core_is_exportmd: ========================================== Convert the SysML models to Canonical XMI ========================================== .. todo:: It starts from the mdzip. The first script generates unordered XMI, the second orders to create the Canonical XMI. #. Drag and drop the Core_model folder onto the STEPlib/utils/MagicDraw/genXMIFromFolder.bat #. Drag and drop the Core_model/dvlp/core_model.mdzip onto the STEPlib/utils/MagicDraw/genXMIFromFolder.bat * THIS DOES NOT WORK FOR ME - SO USE THE VERSION IN THE GIT Or execute the following calls: :: cd STEPlib/utils/MagicDraw for /D %i in (../../Core_model/*) do (ruby "to_cxmi.rb" mdzip="../../Core_model/%i/dvlp/%~ni.mdzip" ruby "..\ExpToXMI\to_cxmi.rb" xmi="../../Core_model/%i/%~ni.xmi" ruby "..\ExpToXMI\to_cxmi.rb" xmi="../../Core_model/%i/%~ni.di") //ruby "to_cxmi.rb" mdzip="../../Core_model/ProductDataManagement/dvlp/ProductDataManagement.mdzip" //ruby "..\ExpToXMI\to_cxmi.rb" xmi="../../Core_model/ProductDataManagement/ProductDataManagement.xmi" //ruby "..\ExpToXMI\to_cxmi.rb" xmi="../../Core_model/ProductDataManagement/ProductDataManagement.di" ========================== Generate All - batch ========================== .. todo:: convert this into batch script with arguments for {core_model} and {Core} and hardcoded relative paths {Harmo} Execute the following calls (replacing your relative path to Harmo\STEPlib\):: :: del /q AntPub\output\data\core_model\* /s rmdir /s /q AntPub\output\data\core_model mkdir AntPub\output\data\core_model mkdir AntPub\output\data\core_model\pictures mkdir AntPub\output\data\core_model\refdata mkdir AntPub\output\data\core_model\sys mkdir AntPub\output\data\core_model\sys\script xcopy AntPub\input\script AntPub\output\data\core_model\sys\script /s /e powershell Compress-Archive -Path ..\Core_model\refdata\*.owl -DestinationPath AntPub\output\data\core_model\Core_model_RD.zip xcopy ..\Core_model AntPub\output\Core_model\ /s /exclude:savezip.txt powershell Compress-Archive -Path AntPub\output\Core_model -DestinationPath AntPub\output\data\core_model\Core_model.zip del /q AntPub\output\Core_model /s rmdir /s /q AntPub\output\Core_model del /q Antpub\input\maps\* cd ExtractID del /q output\html\* java -jar ../saxon9-8-0-6.jar -t VariablesDataCore.xml CanonicalGenerateIDsXML.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core VariablesDataCore.xml CanonicalExtract_ID.xsl // rename images if not using macro java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core relativePath=..\..\Core_model\ ./output/sysml_models_ids.xml CanonicalRenameMDimages.xsl move output\renameimages.bat ..\..\Core_model\. ..\..\Core_model\renameimages.bat // copy and move images and sysml_models_ids xcopy ..\..\Core_model\_*.png ..\AntPub\output\data\core_model\pictures xcopy output\html\* ..\AntPub\input\maps move output\html\* ..\AntPub\output\data\core_model copy output\sysml_models_ids.xml ..\AntPub\input\. /y cd ../AntPub xcopy .\input\CoreSTEPmod_files\data\* .\output\data /s /e //xcopy ..\..\utils\AntPub\input\CoreSTEPmod_files\data\* .\output\data /s /e java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core split4=1 splitModel=1 variablesFileName=VariablesDataCore.xml ../../Core_model/Core_model.xmi CanonicalDomainModel_clause4.xsl --suppressXsltNamespaceCheck:on 2>4000_4_error.log java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml splitModel=1 ../../Core_model/Core_model.xmi CanonicalDomainModel_clause5.xsl 2>4000_5_error.log java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml ./input/sysml_models_ids.xml termtag=DMterms DomainModel_annex_bom_expg.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml termtag=DMterms ./VariablesDataCore.xml TermsDefs.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml nr_or_biblio=nr ./VariablesDataCore.xml NormRefs_Biblio.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml nr_or_biblio=biblio ./VariablesDataCore.xml NormRefs_Biblio.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml ./VariablesDataCore.xml CanonicalDomainModel_index.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml ./VariablesDataCore.xml ReferenceData.xsl --suppressXsltNamespaceCheck:on java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml ./VariablesDataCore.xml Canonical_index.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core ./VariablesDataCore.xml renumber_figurestables.xsl --suppressXsltNamespaceCheck:on java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core variablesFileName=VariablesDataCore.xml ../../Core_model/Core_model.xmi CanonicalDomainModel_Home.xsl java -jar ../saxon9-8-0-6.jar -t model_to_generate=Core ./VariablesDataCore.xml xhtml_to_htm.xsl del /q output\data\core_model\sys\*.xhtml del /q output\data\core_model\sys\*.xml move from the AntPub/output/data/* to the /iso10303_2xx/data:: move AntPub\output\data\* \iso10303_243\data .. sectionauthor:: |Judith Crockford| .. include:: /keywords.rst