====== IG.GFX.ShapeCreator ======
If you searching for the JSON format specification, use [[ig:gfx:shapecreator:specification|this Link]]!
The IG.GFX.ShapeCreator is a tool, to build SVG shapes for furniture products. It is intended to be used to create twodim symbols.
===== Getting the IG.GFX.ShapeCreator =====
The IG.GFX.ShapeCreator is located inside IG NextCloud xchange folder or can be given as download url. Ask the admin or IG for access if needed.
Save the latest Zip Version on your PC and unzip it.
Alternatively, you can check out the current version as a ZIP file from the GIT repo **ig.graphics.data/Tools**.
The zip file contains an folder.
===== Setting up the IG.GFX.ShapeCreator =====
=== Running the IG.GFX.ShapeCreator for the first time ===
As soon as the Zip is unpacked, the execution file can be run from the command line or the terminal.
Open a command line or terminal inside the IG.GFX.ShapeCreator folder and run the excecution file by typing it into the command line:
**Command for Windows cmd**
\ShapeCreator-[Version]> IG.GFX.ShapeCreator.exe
**Command for Linux or Mac terminal**
/ShapeCreator-[Version]> mono IG.GFX.ShapeCreator.exe
Because nothing is setup, the program will return all available parameters.
Command Line Arguments:
-file= OR -include= - input filepath or batch mode, required
-domain= - IG.GFX Domain, required
-subDomain= - IG.GFX Sub Domain, required
-user= - User Id, deprecated. Use environment variable IG_GFX_USER instead.
-password= - Password, deprecated. Use environment variable IG_GFX_PWD instead.
-outline=NONE|BOX|SHAPE|SHAPES - outline mode, optional, SHAPE is default
-output= - write output to specified folder instead of "Shapes", optional
-format=PNG|JPG - specify preview output format, optional, PNG is default
-force - force overwrite shapes and previews (if preview option), optional
-preview - generate preview images for the products, optional
-points - generate json file for attach points, optional
-points_prefix - attach prefix before the default filename points.json, optional
=== Running the IG.GFX.ShapeCreator with a shapes.json and create batch or shell ===
To run the IG.GFX.ShapeCreator correctly, two files need to be set up.
**Requirements**
* shapes.json
* create.bat
* IG.Creator Login
The first file is a so-called shapes.json file. It holds information about the model, products and shape construction plans. Use this [[ig:gfx:shapecreator:specification|Link]] for a format specification and example scripts.
The second file is a so-called create batch or shell file (depends on OS), that gives the shapes.json to the executable. Inside this file, the parameters form the first start of the IG.GFX.ShapeCreator will be inserted.
**Setting up the batch file**
It is recommended to place the batch file parallel to the "shapes.json" and to place both files in a subfolder for the respective model.
Batch file
**for Windows**
REM Path to IG.GFX.ShapeCreator executable
SET IG_GFX_SHAPECREATOR=\ShapeCreator-[Version]\IG.GFX.ShapeCreator.exe
REM Call EXE
%IG_GFX_SHAPECREATOR% -domain=DataDomain -subDomain=DataSubDomain -file=shapes.json -output=commercial\products --preview --force
:!: Make sure you giving your IG.Creator login credentials by the IG_GFX_USER and IG_GFX_PWD global system variables :!:
**for Linux or Mac**
# Path to IG.GFX.PhotoCreator executable
IG_GFX_SHAPECREATOR=/ShapeCreator-[Version]/IG.GFX.ShapeCreator.exe
$IG_GFX_SHAPECREATOR -domain=DataDomain -subDomain=DataSubDomain -file=shapes.json -output=commercial/products --preview --force
:!: Make sure you giving your IG.Creator login credentials by the IG_GFX_USER and IG_GFX_PWD system variables :!:
Run the create file from the command line or terminal. It will create the shape files in the desired folder (here commercial\products (Windows) or commercial/products (Mac, Linux)).
**Notes about the parameters**
* -domain= and -subDomain= must be given with valid IG.Creator workspace informations
* IG_GFX_USER and IG_GFX_PWD must be given by system variables and must have access granted to the IG.Creator workspace for the **ShapeCreator** license
* -output= is used for the output directory
* --preview generates additional, optional preview files (format JPG)
* --force tells the IG.GFX.ShapeCreator.exe to overwrite existing shape files
=== Running the IG.GFX.ShapeCreator in batch mode over directories ===
It is possible do use an batch file with the following code template for that purpose.
Prerequisites:
* Directory contains all models (here **.\models**) as sub folder. The model directory name should match the SubDomain name of the IG.Creator login credentials.
* Replace DOMAIN with your domain which match the IG.Creator login credentials.
@echo off
set back=%cd%
for /d %%i in (.\models\*) do (
cd "%%i"
echo current directory:
cd
call %IG_GFX_SHAPECREATOR% -domain=DOMAIN -subDomain="%%i" -file=shapes.json -output=commercial\products --preview --force
cd %back%
)
===== Problems and how to solve=====
You need to specify a valid user and password by environment variables IG_GFX_USER and IG_GFX_PWD.
* Make sure to use a valid Creator login. Ask the admin for help.
-------
Unbehandelte Ausnahme: System.ArgumentException: Illegales Zeichen im Pfad.
...
* Check the json file for unallowed characters
* The following characters can lead to this error
* | inside the Id
* ä, ö, ü, ß
* Check using valid json code