hello
in autocad block 4 line TXT
TXT1 (handle # 3)
TXT2 (handle # 2)
TXT3 (handle No. 4)
TXT4 (handle # 1)
When I recuper the string in a combobox it puts me in the order of handle
TXT4,2,1,3
I then I want in the order of the line screen TXT1,2,3,4
Thank you for your help
********
Bonjour
Dans le bloc autocad 4 lignes de TXT
TXT1 (handle N°3)
TXT2 (handle N°2)
TXT3 (handle N°4)
TXT4 (handle N°1)
Quand je recupere le string dans une combobox il me le met dans l'ordre du handle =>Ligne 4,2,1,3
alors que je je veux dans l'ordre de l'écran ligne 1,2,3,4
Merci pour votre aide
Public Sub LireTxt() Dim objBloc As AcadBlock Dim objEnt As AcadEntity Dim objEntTxT As as AcadText ThisDrawing.Utility.GetEntity objBlocRef, Pt1, "Sélectionnez le bloc à modifier :" Set objBloc = ThisDrawing.Blocks(objBlocRef.Name) For Each objEnt In objBloc If objEnt.ObjectName = "AcDbText" Then ListBoxTxt.AddItem objEntTxT.textString Endif Next End Sub
you have to:
1) store LineTexts text in a temporary array
2) order the array
3) fill listbox with sorted array content
see the attached example
bye
I got it that you wanted texts sorted by their text value
you'll find the revised code for sorting by text insertion point "Y" coordinate in
bye
Can't find what you're looking for? Ask the community or share your knowledge.