Draw order management ideas

Draw order management ideas

Anonymous
Not applicable
240 Views
2 Replies
Message 1 of 3

Draw order management ideas

Anonymous
Not applicable
Here is my problem. I have AutoCAD objects (coordinates, color, everything that I need to recreate the object) in a database.

The app is supposed to read an entire drawing, put all the coordinates, properties and positions... in the database, and allow to recreate all these objects anywhere.... witch works great....

Here is the problem: When I query the database to get all the objects, the stored procedure gives them all in a specific order (per object type, thus all arcs, then all lines, then all circles, ...). I would like to put all these objects back in the same order that they were when I read the drawing the first time, without having to keep a (0 to NumberOfObjects) array of handles. (even if I did, handles are only good inside a drawing, and since I change drawing, handles are not constant...).

I need an object drawing order management technique that would be easy to implement, and that is not based on handles....

Weird hen!?!
Let me know if anyone has an idea....

Tanks
0 Likes
241 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Since database does not store records in certain order, if you need to
retrieve records in particular order, you must sort it in your
"SEELCT...ORDER BY..." statement. That means, you need a column that can
sort the records in a order as yu wish.

I do not know why you have to drawing this AcadEntity in the exact order as
they were retrieved into database, but you can have a column of
Interger/Long type and assing it an increment value whenever a new record is
inserted.

wrote in message news:5105110@discussion.autodesk.com...
Here is my problem. I have AutoCAD objects (coordinates, color, everything
that I need to recreate the object) in a database.

The app is supposed to read an entire drawing, put all the coordinates,
properties and positions... in the database, and allow to recreate all these
objects anywhere.... witch works great....

Here is the problem: When I query the database to get all the objects, the
stored procedure gives them all in a specific order (per object type, thus
all arcs, then all lines, then all circles, ...). I would like to put all
these objects back in the same order that they were when I read the drawing
the first time, without having to keep a (0 to NumberOfObjects) array of
handles. (even if I did, handles are only good inside a drawing, and since
I change drawing, handles are not constant...).

I need an object drawing order management technique that would be easy to
implement, and that is not based on handles....

Weird hen!?!
Let me know if anyone has an idea....

Tanks
0 Likes
Message 3 of 3

Anonymous
Not applicable
Yep, I expected that answer. The incrementing integer value is a good idea tought... didn't think about that.

The reason an ORDER BY wont work, is that the objects are stored in different tables, and since the objects are already KEYed according to their logical position (in a certain Site, Building, Floor and Room) the order by on an unKEYed column is out of the question (way too slow).

But I will be able to use an auto-incrementing integer value to be stored with all objects, then store it in the object's XData. When all objects are created, I will loop trought the objects XDatas and set their draw order according to that number.

I think that should work.
(secondly: Since I am using Batch inserts (one insert for all objects of a certain type), I will generate the Integer value VB side, so I'll know for sure thats its representing the draw order).

Tansk alot for the input. My mind getting numb thinking about this..... 😉

TY!
0 Likes