trevorsandy / lpub3d

An LDraw™ editor for LEGO® style digital building instructions.
https://trevorsandy.github.io/lpub3d/
130 stars 19 forks source link

Option to set default global values for build instruction setup #715

Closed Dark-Noir closed 1 year ago

Dark-Noir commented 1 year ago

Hey,

as far i know saves LPub3D stuff like page size, model scale etc. directly into the .ldr file and it is not possible to change the default values for everything at "Build Instruction Setup" (its grayed out when no .ldr file is loaded).

It would be nice if you can add a option to set them globally and save it in the LPub3D.ini. So that every instruction i create have the same default global values at start.

trevorsandy commented 1 year ago

Thank you for your request.

So that every instruction i create have the same default global values at start.

To achieve the behaviour described in your request, LPub3D has implemented an include file capability since v2.4.0 - see #396.

Assuming you have a header.ldr file containing your shared meta commands in the same folder as your loaded model file, the LPub meta command to load this include file with your model file load is:

0 !LPUB INCLUDE "header.ldr"

If your include file is not in the same folder as the model file, you must replace "header.ldr" with either "<relative path>/header.ldr" or "<absolute path>/header.ldr".

Note that part type 1-5 lines in the include file is not supported.

While you can place an include file anywhere in the model file, it is better to place it at the top of the main model file. For example:

0 FILE Car.ldr
0 Example Car for Demonstration of LDRAW Library
0 Name: car.ldr
0 Author: James Jessiman
0 !LPUB INCLUDE "header.ldr"
...

Cheers,