VBA ne propose pas de fonctions pour modifier l'ordre de tracé d'une entité. On peut cependant utiliser SendCommand
pour lancer la commande ORDRETRACE
(_DRAWORDER
) :
Public Sub MoveToTop()
Dim object As AcadObject
Dim pt As Variant
ThisDrawing.Utility.GetEntity object, pt, "Sélectionnez une entité:"
ThisDrawing.SendCommand "_DRAWORDER" & vbCr _
& "(handent """ & object.Handle & """)" & vbCr & vbCr _
& "_F" & vbCr
End Sub
Cet exemple amène au premier plan l'entité sélectionnée. J'utilise une petite astuce, la fonction AutoLISP handent
pour passer un nom d'entité à la commande.
Besoin d'un développement spécifique pour AutoCAD ?
Développement de compléments à AutoCAD et aux autres logiciels Autodesk (AutoCAD Electrical, AutoCAD Mechanical, Inventor, Revit, Vault, Navisworks...). C#/VB/.NET, C++/ObjectARX, AutoLISP, VBA.
Migration de vos projets VBA en .NET, intégration RealDWG dans vos applications, développement sur plateforme AutoCAD OEM et Inventor OEM.
Assistance technique AutoCAD, Inventor, Revit, Vault.
Maxence DELANNOY - Tél. : 06.46.40.75.66 - maxence.delannoy@wiip.fr
|
Add new comment