Select to view content in your preferred language

layer.SendToBack and GroupElements

200
0
02-27-2023 12:44 PM
AndrewAlexander1
Emerging Contributor

Hello,

We just converted over the code we were working on from 2.x to 3.x.  Everything, that we know of, is updated and seems to be working fine, except:

A description of the thing that is not working. This worked fine in 2.x.

//Created a polygon with text, added it to a layer
var elemTxtBox = symLayer.AddElement(polyTxtGra);

//need to get this new element behind some others
symLayer.SendToBack(elemTxtBox);

//added the element to an Element list so we can group them
glyphElems.Add(elemTxtBox);

//this will err, but only when doing the "symLayer.SendToBack(elemTxtBox)" above
symLayer.GroupElements(glyphElems);

If the SendToBack command is not called, nothing errs.  But then the elemTxtBox is on top of the other elements, which is not what we want.

I get a null reference when trying the Group Elements, however everything involved is there, there is nothing that is null.

Thanks
Andy

 

 

 

 

0 Kudos
0 Replies