M
M
MegaTort2021-07-03 23:15:24
Python
MegaTort, 2021-07-03 23:15:24

How to get object coordinates in Autocad using VBA\Python?

I can connect via API to AutoCAD
acad = win32com.client.Dispatch("AutoCAD.Application")
doc = acad.ActiveDocument
sp = doc.ModelSpace

I can loop through the objects and select the ones I need
for i in sp

Is there any property to get coordinates of any object?
That is, I can see the coordinates of the object in the autocad itself, but how can I get the coordinates of the object using VBA?

I can get the coordinates, for example, by selecting the object
cor = doc.Utility.GetEntity()

Isn't there a property to get the coordinates of any object?

And is there any method to get objects in the selection, not just a method to get a single object (doc.Utility.GetEntity() ) ?
What is the point. I want to get the objects in the selected area (those that I will select myself, with my hands in autocad) and get their coordinates, so that I can further process them the way I want

. Poking around in the documentation, I couldn’t find something similar, or I’m just looking badly

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2021-07-04
@Iv_and_S

Is there some property to get the coordinates of any object?
- No.
how do you imagine the same logic for obtaining the coordinates of a polyline and, for example, a block entry.
first understand what type of object is in front of you, then get its "coordinates".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question