To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cadOpen lugnet.cad in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / 14325
14324  |  14326
Subject: 
LDList Documentation (Was: LDD vs LDraw)
Newsgroups: 
lugnet.cad
Date: 
Wed, 20 Dec 2006 15:16:34 GMT
Viewed: 
2678 times
  
Ah ha, it looks like all I missed was the return(1) to let LDList know the ldglite window accept drops.

Since it seems to work now, I’d like to gather the scattered LDList documentation here and retitle this part of the thread so I can find it again.

First some Ideas and bugs:

It might be nice to be able to disable LDList as a part drop target, or at least disable the part count decrementor for dropping in ldlist. I’ve noticed that once you’ve dragged a part into the ldlist window ( or any other drop target like ldglite), you can also decrement the part count simply by clicking on a part name. That’s too easy to do by mistake, so I suspect it’s a bug in ldlist.

It might also be nice if LDList could get the ldrawdir from the ldraw.ini file if the environment variable isn’t set.

And while I’m at it, I wonder if we couldn’t use a simple drop target program that could be used to *generate* the part list files. Maybe modify LDList so you could run 2 copies, one with the entire part list as a drag source, and one with a part list as a drag target. Then increment the part count when you drop a part into the target, and allow saving the set list when you’re done.

Or hmmm, I’ve got all the goodies in the ldglite sources except for saving a .set file. Plus, I could probably steal the peeron importer code to generate .set lists from there as well. Double hmmm...

Now for the LDList documentation (gathered from lugnet posts).




Working with custom set/part lists:

The LDList program has the beginnings of this functionality, you can load a set list and only see the parts in that set, and the number of parts remaining, but it does not keep track of different colours.

Using LDList with MLCAD:

Unfortunately MLCad doesn’t support Drag&Drop from LDList, so the best you can do is like this:

Get LDList.

Create a set list for your set (xyz.set). A set list is just a text file with one line for each part:

10 3001
5 3002
...

Start LDList and load the set. Now you will only see the parts from the set, and the number available.

Start building in MLCad, but remember that each time you fetch a new part, you should also go to LDList and drag the same part from the text list to the graphical view (of LDList). The count will go down.

Using LDList with ldglite:

Ldglite works with LDList in two ways. You can launch LDList and ldglite independently. Then load a set into LDList or work from the main part list. Put ldglite into edit mode and drag parts from LDList into ldglite. The parts will be inserted into the model in ldglite, and if working on a custom set in LDList, the part count will decrement.

LDList can also be installed as a plugin in ldglite. To install it, copy the LDList executable into the plugins subdirectory for ldglite. Make sure to run LDList from there at least once to generate the main part list, or just copy a previously generated part list (ldrawlist.txt) into the plugins directory. Then you can launch LDList from the ldglite plugins menu (keyboard shortcut /ep ldlist).



LDList Drag and Drop Protocol:

I capture the mouse on a drag operation in LDLIST, and send the following message to each window the cursor passes (once every time the underlying window changes):

 (* cds is a WM_COPYDATA structure *)

 cds.dwData := 0;
 cds.cbData := 0;
 cds.lpData := nil;
 Response := SendMessage(h, WM_COPYDATA, Handle, longint(@cds));

and I expect a Response = 1 if the window accepts drops, 0 otherwise (default if the message itself is not handled). In Delphi this is achieved by setting Message.Result := 1; before exiting the message routine.

This is used to change the dragging cursor.

When a drop is performed, I send the following message:

 cds.dwData := 1;
 cds.cbData := SizeOf(CopyRecord);
 cds.lpData := @CopyRecord;
 SendMessage(h, WM_COPYDATA, Handle, longint(@cds));

If you want, you can acknowledge the drop in the same way as above (or perhaps an error number if the sent string doesn’t make any sense to your program), but as you see, for the moment I ignore the return code.

The CopyRecord is defined as:

type
  TCopyRecord = record
    X, Y: integer;
          (* this means 32-bit integers *)
    s:    packed array[0..255] of char;
          (* This one is filled with a null-terminated string *)
  end;

The record and CopyDataStruct that you receive in the message is filled and sent in the following way:

 CopyRecord.X := p.X;
 CopyRecord.Y := p.Y;
 StrPLCopy(CopyRecord.s, TheString, SizeOf(CopyRecord.s));
 (* Making a null-terminated string, guaranteed not to overflow *)

The X and Y are screen coordinates, it’s up to the receiver to convert to window coordinates for the receiving window.

The string is of the format “6060.DAT Arch 1 x 6 x 3 & 1/3 with Curved Top” (i.e. it looks exactly like the status panel in LDList). It’s up to the receiver to find this part in the LDRAW search hierarchy.



Message is in Reply To:
  Re: LDD vs LDraw
 
(...) I think this excerpt from a mail between me and someone else is the only written documentation: -8<---...--- BEGIN ---...--- I capture the mouse on a drag operation in LDLIST, and sends the following message to each window the cursor passes (...) (18 years ago, 14-Dec-06, to lugnet.cad)

33 Messages in This Thread:












Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR