Jump to content

Recommended Posts

Posted (edited)

Hi,

Can somebody help me figure something out,

I want to make new parts in Ldraw and save each dat file in a directory then I want to load each file onto the script of the model instead of having the code for each part in there.

How would you join two bricks together by scripting? (may be app Metadata), in LDraw there must be the code for the mapping of each part as to where abouts it is.

For example:

A 1x1 brick code is:

0 Brick 1 x 1
0 Name: 3005.dat
0 Author: James Jessiman
0 !LDRAW_ORG Part UPDATE 2002-03
0 !LICENSE Redistributable under CCAL version 2.0 : see CAreadme.txt
0 BFC CERTIFY CCW
0 !HISTORY 2001-10-26 [PTadmin] Official Update 2001-01
0 !HISTORY 2002-05-07 [unknown] BFC Certification
0 !HISTORY 2002-06-11 [PTadmin] Official Update 2002-03
0 !HISTORY 2007-05-07 [PTadmin] Header formatted for Contributor Agreement
0 !HISTORY 2008-07-01 [PTadmin] Official Update 2008-01
0 BFC INVERTNEXT
1 16 0 24 0 6 0 0 0 -20 0 0 0 6 box5.dat
4 16 10 24 10 6 24 6 -6 24 6 -10 24 10
4 16 -10 24 10 -6 24 6 -6 24 -6 -10 24 -10
4 16 -10 24 -10 -6 24 -6 6 24 -6 10 24 -10
4 16 10 24 -10 6 24 -6 6 24 6 10 24 10
1 16 0 24 0 10 0 0 0 -24 0 0 0 10 box5.dat
1 16 0 0 0 1 0 0 0 1 0 0 0 1 stud.dat
0

So If I wanted to join another one ontop of that (the part is 3005) but without any of them being rotated from another (since they are 1 stud they are able to do this in real life) id have to figure out some way of putting a section of code between the two parts in the model file.

Note how in the script above there is the areas of that part (3005) such as box.dat and stud. dat , I could use these too. not sure yet

When I stack two 3005 bricks using the GUI and save the model the code of the file is tiny! which I dont get because how do know what is happening if there is little code, I wont know the part colour, etc, etc, etc (maybe it does explain everything that we see in the model but I doubt it)

Here is the code of the file that has x2 3005 bricks stacked on-top of one another:

0 Brick 1 x 1
0 Name: 3005.dat
0 Author: James Jessiman
0 Unofficial Model
1 16 -10 7.73205 1.000001 -0 0 -1 -0.5 0.866025 0 0.866025 0.5 -0 3005.dat
1 16 -10 -13.052557 -10.999997 -0 0 -1 -0.5 0.866025 0 0.866025 0.5 -0 3005.dat

Also, here is the file:

http://www.brickshel...s/ge/3005x2.ldr

If the above link does not work right click it and hit 'save target as' OR hit 'save link location' if you are using mac O. (yes I did forget to change the model author in the above code of the model)

So in theory this whole thing is just building and making the parts in code.

Edited by SNIPE

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...