Lpub4

Tips and Tricks

LPub4 is a great tool, but has a lot of idiosyncrasies. Here are some I've learned.

Bill of Materials (BOM)

In Bill of Materials, you can set the size constraint to "Area", then adjust the shape interactively by clicking on the BOM border and dragging the handle. If you turn off the border, you lose the ability to display or grab the handle.

BOM Overlapping with the first step? Check that the INSERT BOM meta command is not inside a MULTISTEP meta command. Check that there is a STEP command before and after your INSERT BOM command and between the INSERT BOM command and the first step.

Images

When you insert an image, LPub4 refers to it by its full, absolute path. So even if you move the images with .mpd file, it will still look for them in the original location. You can edit the path in the LDraw file pane to a relative path to solve this.
Before:

0 !LPUB PAGE BACKGROUND PICTURE "C:/Users/Brian/CloudStation/LEGO/models/Technic/GBC/Test Fixture/parchment1175 blue.png" STRETCH

After:

0 !LPUB PAGE BACKGROUND PICTURE "./parchment1175 blue.png" STRETCH

Rotate and Unrotate callout has no affect

I don't know the correct solution to this. There is this bug which may be related. It could be that the "normal" view and rotated view are the same. My workaround was to rotate all the parts in the submodel in MLCAD.

Background image and/or page border disappear? Check for a missing or invalid PAGE BACKGROUND meta command.

INSTANCE COUNT with GHOSTed parts

LPub4 will count ghosted submodels. To not count them, enclose the GHOSTed part with LPUB PART BEGIN IGN and LPUB PART END. e.g.

0 BUFEXCHG A STORE
1 0 164.578 -137.864 -75 0.992546 -0.121869 0 0.121869 0.992546 0 0 0 1 inbasketramp.ldr
0 STEP
0 BUFEXCHG A RETRIEVE
0 !LPUB PART BEGIN IGN
0 GHOST 1 0 164.578 -137.864 -10 0.992546 -0.121869 0 0.121869 0.992546 0 0 0 1 inbasketramp.ldr
0 !LPUB PART END

METACOMMANDS

A complete list of LPub meta commands is available from the help menu.

Viewing angle of parts in a parts list

You can change this on a per-step basis with the PLI VIEW_ANGLE command. This is helpful when you need to differentiate between similar parts, such as normal plates and Technic plates.

0 !LPUB PLI VIEW_ANGLE 45.0000 -45.0000

Page size issues

Issue: when page is sized to 8.5 in wide by 5.5 tall, the PDF print is not sized correctly.
Workaround: export as PNG files instead.

Issue: when exporting to .png, then importing to PDF, the page size is 5 times larger than expected. The problem seems to be that the .png files are created with a dpi of 47.24 instead of the value set by !LPUB RESOLUTION GLOBAL 600 DPI.
Workaround: Set the dpi five times greater using another software, such as Imagemagick, using

magick mogrify -density 236.2 *page*.png

Manipulating the display of parts lists

https://sites.google.com/site/workingwithlpub/general/advanced-techniques/pli-controlfile

Changing what gets a length annotation in a parts list

You can't, except by renaming parts. Philo has a workaround he implemented for VEX.

Buffer exchange

When using buffer exchange to show a pre-positioned part, surround the GHOSTED parts with LPUB PLI BEGIN IGN/LPUB PLI END to tell LPub not to add the part to the BOM or parts list.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License