LDraw.org Discussion Forums
LPub3D substitute submodel in assembly - Printable Version

+- LDraw.org Discussion Forums (https://forums.ldraw.org)
+-- Forum: LDraw Programs (https://forums.ldraw.org/forum-7.html)
+--- Forum: LDraw File Processing and Conversion (https://forums.ldraw.org/forum-22.html)
+--- Thread: LPub3D substitute submodel in assembly (/thread-22216.html)



LPub3D substitute submodel in assembly - Merlijn Wissink - 2017-06-30

So, I have a question regarding LPub3D, or rather using the available meta commands in a specific way.
I have a submodel that is 'formed'; all hinges are rotated. Then I have a copy of that submodel which is non-formed; completely straight. I want LPub to generate instructions for the non-formed version, but then showing the formed version in the assembly. I hope that makes sense to anyone.

Is there a way to do this? I can vaguely remember I did something like this in the past, but I wasn't able to find my implementation so I'm not sure it's even possible. Any ideas?


RE: LPub3D substitute submodel in assembly - Jaco van der Molen - 2017-06-30

(2017-06-30, 7:41)Merlijn Wissink Wrote: So, I have a question regarding LPub3D, or rather using the available meta commands in a specific way.
I have a submodel that is 'formed'; all hinges are rotated. Then I have a copy of that submodel which is non-formed; completely straight. I want LPub to generate instructions for the non-formed version, but then showing the formed version in the assembly. I hope that makes sense to anyone.

Is there a way to do this? I can vaguely remember I did something like this in the past, but I wasn't able to find my implementation so I'm not sure it's even possible. Any ideas?

I would suggest you make use of the REMOVE GROUP meta and grouping like MLCad does.
This way you can put all your hinge parts in groups and then add a last step where you "remove" all the groups and place all hinges formed.
I could help you if you're willing to sent me the model via pm or e-mail. I'll take a look.


RE: LPub3D substitute submodel in assembly - Merlijn Wissink - 2017-06-30

(2017-06-30, 14:24)Jaco van der Molen Wrote:
(2017-06-30, 7:41)Merlijn Wissink Wrote: So, I have a question regarding LPub3D, or rather using the available meta commands in a specific way.
I have a submodel that is 'formed'; all hinges are rotated. Then I have a copy of that submodel which is non-formed; completely straight. I want LPub to generate instructions for the non-formed version, but then showing the formed version in the assembly. I hope that makes sense to anyone.

Is there a way to do this? I can vaguely remember I did something like this in the past, but I wasn't able to find my implementation so I'm not sure it's even possible. Any ideas?

I would suggest you make use of the REMOVE GROUP meta and grouping like MLCad does.
This way you can put all your hinge parts in groups and then add a last step where you "remove" all the groups and place all hinges formed.
I could help you if you're willing to sent me the model via pm or e-mail. I'll take a look.

Hmm, not sure what you mean. I never really used MLCad very much, also never heard of the group meta.
I'll see if I can send anything.


RE: LPub3D substitute submodel in assembly - Jaco van der Molen - 2017-06-30

I'll make an example and mail you.


RE: LPub3D substitute submodel in assembly - Kevin - 2017-07-03

I think I did something like this in the instructions I created for Jason Allemann's Hoberman Sphere (pages 9-12):
 
http://jkbrickworks.com/hoberman-sphere-stand-instructions/#5971

I don't think the LDraw file on his site retains the formatting, but I'd be happy to send you the source if it will help.

Kevin


RE: LPub3D substitute submodel in assembly - Jaco van der Molen - 2017-07-03

Here is a very quick and dirty model that uses the Remove Group meta from LPub and can remove MLCad grouped bricks from any step.

Code:
0 Author: Jaco van der Molen
0 !LICENSE Free for non-commercial use.
0 !LPUB MULTI_STEP BEGIN
0 ROTATION CENTER 0 0 0 1 "Custom"
0 ROTATION CONFIG 0 0
1 4 0 0 0 1 0 0 0 1 0 0 0 1 3894.dat
1 0 40 10 -10 0 1 0 0 0 1 1 0 0 2780.dat
1 0 -40 10 -10 0 0 -1 0 1 0 1 0 0 2780.dat
0 STEP
0 MLCAD BTG A
1 2 80 0 -20 1 0 0 0 1 0 0 0 1 3894.dat
0 MLCAD BTG A
1 0 120 10 -30 0 0 -1 0 1 0 1 0 0 2780.dat
0 GROUP 2 A
0 STEP
0 !LPUB PLI CONSTRAIN LOCAL HEIGHT 3.24
0 MLCAD BTG B
1 14 160 0 -40 1 0 0 0 1 0 0 0 1 3894.dat
0 MLCAD BTG B
1 0 200 10 -30 0 0 -1 0 1 0 1 0 0 2780.dat
0 GROUP 2 B
1 1 -50 -50 -20 0 1 0 1 0 0 0 0 -1 3702.dat
0 BUFEXCHG A STORE
0 MLCAD ARROW 1 160 -56 -40 1 0 0 0 1 0 0 0 1  16 6 12 40  0 50 2 0  0 0
0 MLCAD SKIP_BEGIN
3 0 148 -56 -40 160 -64 -40 160 -48 -40
4 0 160 -59 -40 164.901 -58.7592 -40 164.313 -52.7881 -40 160 -53 -40
4 0 164.901 -58.7592 -40 169.755 -58.0393 -40 168.584 -52.1546 -40 164.313 -52.7881 -40
4 0 169.755 -58.0393 -40 174.514 -56.847 -40 172.773 -51.1054 -40 168.584 -52.1546 -40
4 0 174.514 -56.847 -40 179.134 -55.194 -40 176.838 -49.6507 -40 172.773 -51.1054 -40
4 0 179.134 -55.194 -40 183.57 -53.0961 -40 180.741 -47.8045 -40 176.838 -49.6507 -40
4 0 183.57 -53.0961 -40 187.779 -50.5735 -40 184.445 -45.5847 -40 180.741 -47.8045 -40
4 0 187.779 -50.5735 -40 191.72 -47.6505 -40 187.913 -43.0125 -40 184.445 -45.5847 -40
4 0 191.72 -47.6505 -40 195.355 -44.3553 -40 191.113 -40.1127 -40 187.913 -43.0125 -40
4 0 195.355 -44.3553 -40 198.651 -40.7197 -40 194.012 -36.9133 -40 191.113 -40.1127 -40
4 0 198.651 -40.7197 -40 201.573 -36.7785 -40 196.585 -33.4451 -40 194.012 -36.9133 -40
4 0 201.573 -36.7785 -40 204.096 -32.5698 -40 198.805 -29.7415 -40 196.585 -33.4451 -40
4 0 204.096 -32.5698 -40 206.194 -28.1342 -40 200.651 -25.8381 -40 198.805 -29.7415 -40
4 0 206.194 -28.1342 -40 207.847 -23.5142 -40 202.105 -21.7725 -40 200.651 -25.8381 -40
4 0 207.847 -23.5142 -40 209.039 -18.7545 -40 203.155 -17.584 -40 202.105 -21.7725 -40
4 0 209.039 -18.7545 -40 209.759 -13.9009 -40 203.788 -13.3128 -40 203.155 -17.584 -40
4 0 209.759 -13.9009 -40 210 -9 -40 204 -9 -40 203.788 -13.3128 -40
0 MLCAD SKIP_END
0 STEP
0 BUFEXCHG A RETRIEVE
0 !LPUB REMOVE GROUP "A"
0 !LPUB REMOVE GROUP "B"
0 !LPUB PLI BEGIN IGN
1 2 30 -30 -20 0 1 0 -1 0 0 0 0 1 3894.dat
1 14 0 -60 -40 -1 0 0 0 -1 0 0 0 1 3894.dat
1 0 40 -70 -30 0 0.5 0.866 0 -0.866 0.5 1 0 0 2780.dat
1 0 -40 -70 -30 0 0.5 0.866 0 -0.866 0.5 1 0 0 2780.dat
0 !LPUB PLI END
0 STEP
0 !LPUB MULTI_STEP END
0

The green technic 1x6 brick and one pin is group A

Code:
0 MLCAD BTG A
1 2 80 0 -20 1 0 0 0 1 0 0 0 1 3894.dat
0 MLCAD BTG A
1 0 120 10 -30 0 0 -1 0 1 0 1 0 0 2780.dat
0 GROUP 2 A

Every brick in the group should be preceeded by 0 MLCAD BTG A (where A is the group name and can be any name)
After the last brick in the group you should end with a line that says how many bricks are in the group 0 GROUP 2 A

The yellow brick with a pin is group B in the same way.

In the last steps both these groups are removed from the model.
You can then place the bricks in the right position but should be ignored from the PLI (and BOM) using
 
Code:
0 !LPUB PLI BEGIN IGN
all bricks to be ignored
0 !LPUB PLI END

A buffer exchange is used to remove the arrow.

Study the code and model to understand!

You can code groups by hand but I still use MLCad for that.
Bricks in a group do not necessarily need to be in line but it will make things clear, so it is good practice to end a step with all bricks grouped that later need to be removed.
You can also use a submodel and create a group with only that submodel in it (basicaly a group containing one "brick / submodel") and remove that somewhere in the model instructions.

If you want help with your real model, let me know and mail me the model.


RE: LPub3D substitute submodel in assembly - Merlijn Wissink - 2017-07-03

Thanks Jaco! I'll take a good look at it tomorrow.  Smile


RE: LPub3D substitute submodel in assembly - Merlijn Wissink - 2017-07-05

Ok, just a confirmation: I got it successfully working yesterday. Thanks again Jaco!  Smile


RE: LPub3D substitute submodel in assembly - Jaco van der Molen - 2017-07-05

(2017-07-05, 6:42)Merlijn Wissink Wrote: Ok, just a confirmation: I got it successfully working yesterday. Thanks again Jaco!  Smile

Great! This is such a fine option to create instructions.

Roland/Trevor: if you are reading.... could we implement the LDCad Group meta in LPub3D to achieve the same with the MLCad Group Meta?