- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I am working with AutoCad 2022 and with Excel VBA. In my code, I read in a Excel Worksheet the info that I need from the drawing including the Handle of the Entities I am interested on.
Next step, to verify some Acad Drawing info based on Excel calculations. For this, I pick the Entities Handle ID on Excel and it highlights the Entity on Acad. Some times Entities highlighting doesn't do enough contrast to differentiate the element of my interest between all the other objects and it is hard to see it.
Now I think It would be better if the entity I need to verify get selected, as it is made in Acad environment with the mouse. Unfortunately, the practical way to verify the info is accessing by the Handle ID.
I have looked for alternatives in Internet and found something regarding with SelectionSets, but result was not different of just highlight the entity.
Any suggestion to select (as with the mouse) or to improve the colors or highlighting characteristics of the entities?
I attach some pics how is my highlighted objects showing up.
The code I am using is:
Sub dfSelHnd()
Dim actldwg As AcadDocument
Dim tAr(0) As AcadEntity 'Add items to selectionset must be done with arrays
Dim rng As Range
Dim txt As String
''---
''---
''---
Set rng = Selection
Set actldwg = AutoCAD.Application.ActiveDocument
txt = rng.Value '' txt is the HandleID
Set tAr(0) = actldwg.HandleToObject(txt)
Call zoomit(actldwg, tAr(0))
tAr(0).Highlight (True)
End Sub'''
Solved! Go to Solution.