AutoCAD Map 3D Developer
Welcome to Autodesk’s AutoCAD Map 3D Developer Forums. Share your knowledge, ask questions, and explore popular AutoCAD Map 3D Developer topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to control draw order of AcMapLayer

1 REPLY 1
SOLVED
Reply
Message 1 of 2
woehling
432 Views, 1 Reply

How to control draw order of AcMapLayer

Hi,

 

how can I programmatically control the draw order of my AcMapLayer layers?

I have a map with a "tree of layers" in it (multiple AcMapLayerGroup objects + multiple AcMapLayer objects).

 

Because the tree structure does not match the desired draw order of the layers, I want to change the draw order programmatically.

How can I do this?

 

I've already fumbled around a bit with the AcMapLayer.Group property.

I thought that

  1. setting the AcMapLayer.Group to null

  2. and then setting the AcMapLayer.Group to the group that I want

could solve the problem.

But the behavior ist quite strange -  is there any other way to set the group of a layer?

 

So this workaround (http://adndevblog.typepad.com/infrastructure/2012/08/get-and-set-acmaplayer-order-using-map-3d-platf... does not work for me, because I have to use groups.

 

Regards,

Markus

1 REPLY 1
Message 2 of 2
woehling
in reply to: woehling

I've investigated the problem further and found a solution for me.

The main problem was that I used AcMapMap.AddLayersAsync(), which seems to cause some consequential errors (e.g. draw order of the layers is reversed)

I'm now using AcMapMap.GetLayers().Add(), and the behavior is "not so strange" after all.

I had to fumble around with AcMapLayer.SetOrder() to get the tree structure that I wanted.

Now everything works fine for me.

 

Markus

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost