VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

selection avec le handle vba

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
LimsWolf
493 Views, 2 Replies

selection avec le handle vba

Bonjour, j'ai une simple question,

 

J'ai récupéré le handle de plusieurs entitées à partir d'Excel et maintenant je voudrai selectionner une entité avec son handle

Mon but étant de selectionner une entitée et ensuite de zoomer dessu. Pour l'instant j'ai cela (un zoom sur l'entitée précédente) :

 

Set objetSelectionne = AcadDoc.HandleToObject(Target.Cells.Value)
                Cells(1, 1).Select
                'CouleurOriginale = objetSelectionne.Color
                Call SetForegroundWindow(FindWindowA(vbNullString, AcadObj.Caption))

                AutoCAD.Application.ActiveDocument.SendCommand ("z o p   ")
                'Select.objetSelectionne
                Update

                'objetSelectionne.Color = CouleurOriginale

 

Je voudrai donc remplacer "p" pas le handle...

Mais je sais pas si c'est possible, ou si vous avez une autre solution.

Merci

Cordialement

 

 

2 REPLIES 2
Message 2 of 3
Alfred.NESWADBA
in reply to: LimsWolf

Hi,

 

if you work with SendCommand you can also work with sending a LISP-statement to the commandline.

So you can use

(handent "12D0")

to get the object with handle &h12D0 selected.

 

HTH (and Google translated correctly), - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at ... blog.hollaus.at ... CDay 2024
------------------------------------------------------------------------------------
(not an Autodesk consultant)
Message 3 of 3
LimsWolf
in reply to: LimsWolf

Oh yes !

 

Thx for this idéa, I will work it.

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

Post to forums  

Autodesk Design & Make Report

”Boost