Part annotation in LPub3D


Part annotation in LPub3D
#1
Hi all,

Through regular expressions the part annotation can be extracted from the part description.
I'd like the annotation for Technic Bricks to be only the length (like beams).
The regex now is ^Technic Brick\s+(\d+\s+(x|X)\s+\d+\s*(x*|X*)\s*\d*\.*\d*)\s*.*$
This extracts the full size of the brick, ie. Technice Brick 1 x 16 gives "1 x 16".
What I'd like is only the 16.
How do I do that?

Thanks.
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Part annotation in LPub3D
#2
Try:

Technic: ^Technic Brick\s+\d+\s+[xX]\s+(\d+\s*(x*|X*)\s*\d*\.*\d*)\s*.*$


Regards,

David
Reply
Re: Part annotation in LPub3D
#3
Thanks so much David! That works :-)
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Part annotation in LPub3D
#4
This all works great! Love LPub3D.
Another question regarding part annotation:

With above expression I show only the length of technic bricks.
Great if you have a model with a step that has say a 16 and 14 studs brick.
It is easier to identify longer bricks that way.
But hereĀ“s the thing: using the expression all lengths of all technic bricks are shown.
What if I want to exclude some? Say Technic Brick 1 x 2 with Axlehole. There is no need showing it is 2 studs in length or for a 1 x 2 brick for that matter.
Is there a way to do this, besides hand coding all bricks using only Freeform annotation?

Any thoughts?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Part annotation in LPub3D
#5
Not unreasonably, it looks like it will stop after it has found the first matching regular expression.

So for example, if you add the definition:

Technic: ^Technic Brick\s+\d+\s+.*with Axle.*$

before the definition

Technic: ^Technic Brick\s+\d+\s+[xX]\s+(\d+\s*(x*|X*)\s*\d*\.*\d*)\s*.*$

The Technic Brick with axlehole is not augmented with the length while the other Technic bricks are.

I think the key to what it output is whatever is within the (first?) set of parenthesis. Hence, as the first definition has no parenthesis, it outputs nothing as the annotation title.

I'd imagine that an appropriate definition could be created for small length Technic bricks to not output their length in the annotation.

Regards,

David
Reply
Re: Part annotation in LPub3D
#6
OK, sounds logic. I'll try it.
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Part annotation in LPub3D
#7
David Manley Wrote:Try:
Technic: ^Technic Brick\s+\d+\s+[xX]\s+(\d+\s*(x*|X*)\s*\d*\.*\d*)\s*.*$
Regards,
David
This does not seem to work anymore?
Jaco van der Molen
lpub.binarybricks.nl
Reply
Re: Part annotation in LPub3D
#8
This bug is now fixed in the latest release LPub2D 1.3.2.

Cheers,
Reply
Re: Part annotation in LPub3D
#9
Trevor Sandy Wrote:This bug is now fixed in the latest release LPub2D 1.3.2.
Great! Thanks so much!
Jaco van der Molen
lpub.binarybricks.nl
Reply
« Next Oldest | Next Newest »



Forum Jump:


Users browsing this thread: 3 Guest(s)