PDA

View Full Version : queries to layerservice edges doesn't work


brutal
10-01-2004, 02:22 PM
my @selEdges = lxq(qq(query layerservice edges ? selected));

@selEdges always empty with or without selected edges.

Is it a bug or I do something wrong ?

tjnyc
10-01-2004, 02:44 PM
my @selEdges = lxq(qq(query layerservice edges ? selected));

@selEdges always empty with or without selected edges.

Is it a bug or I do something wrong ?
What is it you are trying to do?

If you just want to get a num count of selected edges you can query with

query layerservice edge.N ? selected

If you want to get a collection of selected edges, I haven't found that one out yet. You might have use a for loop and determine which edge is selected and throw that edge identity into an array or enum. Your edge id will be something like 1:3, 1:4, 1:5 and so on for 3 selected edges in an edge loop/ring.

To try out querying it, I would recommend not using perl, for now. Just go to the Command History -> Results section and play with querying in the command line.

Cheers,

tjnyc
10-01-2004, 03:25 PM
query layerservice edges ? selected

Does give you back a collection of values, but what it gives I do not know. I can select a bunch of edges and execute that command, but what it returns doesn't match up to what I selected. It seems to be locked to a previous set of selection, but I do not know how to clear it and have the query set to recognize the active edge selections.

Cheers,

brutal
10-01-2004, 03:30 PM
If you want to get a collection of selected edges, I haven't found that one out yet. You might have use a for loop and determine which edge is selected and throw that edge identity into an array or enum. Your edge id will be something like 1:3, 1:4, 1:5 and so on for 3 selected edges in an edge loop/ring.
Cheers,
Thanks for your answer. I'm trying to get an array of selected edges.
The same expression for polygons ( and for vertices ):
@my polys = lxq(qq[query layerservice polys ? selected]);

works well and it's very strange for me.


To try out querying it, I would recommend not using perl, for now. Just go to the Command History -> Results section and play with querying in the command line.
Cheers, I've played with command line and had the same result ( empty list of edges). BTW, I had 2 edges selected at that time.

Turq
10-07-2004, 02:57 AM
I've just run into this problem as well. Somehow I managed to have it work correctly for a little while but now I cant get it to function at all. Most of the time it just says I have no edges selected. Sometimes it will say that I have an edge selected that doesnt match what I actually have selected.

This is really annoying since it makes it very hard to create scripts that function consistently while doing edge selections.

EDIT: I think I may have figured out how to make it work consistently, although this is a hack. If you save your edge selections, drop the selection and then reload it, the service should start working correctly.

So you would add this to the top of your perl script.


lx("select.editSet select.hack add");
lx("select.drop");
lx("select.useSet select.hack select");


For whatever reason this will make it operate correctly for a little while. This is a definite bug though.

Turq
10-07-2004, 04:19 AM
Wow.. It looks like the layerservice queries and edges dont work well at all right now. If you try doing a "query layerservice edge.length ? (edgenumber)" then it will send back the position of one of the two verts that make up the edge, but only its x position. So its pretty useless as it doesnt actually give you an edge length.

Also, as an update to my last post, loading and reloading the selection only seems to help solve the problem some of the time. Its still pretty inconsistent.

CGTalk Moderation
01-19-2006, 10:00 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.